Bug 11543

Summary: Increasing test coverage for C4::Category
Product: Koha Reporter: Roman Amor <romanwilton>
Component: Test SuiteAssignee: Chris Cormack <chris>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: enhancement    
Priority: P5 - low CC: kyle
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Proposed patch
Bug 11543: Increasing test coverage for Category.pm
Bug 11543: Increasing test coverage for Category.pm
Bug 11543: Increasing test coverage for Category.pm
Bug 11543: Increasing test coverage for Category.pm
Bug 11543: (followup) Increasing test coverage for Category.pm
[PASSED QA] Bug 11543: Increasing test coverage for Category.pm
[PASSED QA] Bug 11543: (followup) Increasing test coverage for Category.pm

Description Roman Amor 2014-01-14 01:14:36 UTC

    
Comment 1 Roman Amor 2014-01-14 01:27:18 UTC Comment hidden (obsolete)
Comment 2 Daniel Barker 2014-01-14 02:27:22 UTC Comment hidden (obsolete)
Comment 3 Daniel Barker 2014-01-14 02:27:48 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2014-01-14 20:24:04 UTC
This patch assumes that at least one patron category exists, but does not create or mock any.

I believe the test would fail without any categories in the database.

The best course of action would be to create a dummy category before running the test, then roll back the insert at the end of the test.

In addition, it would be good practice to move this file to t/db_dependent since this test is indeed dependent on the database.
Comment 5 Roman Amor 2014-01-14 21:16:13 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2014-01-15 17:48:58 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2014-01-15 17:49:05 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2014-01-15 19:41:06 UTC
Created attachment 24422 [details] [review]
[PASSED QA] Bug 11543: Increasing test coverage for Category.pm

To test:
1. Run prove t/db_dependent/Category.t
2. Apply patch
3. Run prove t/db_dependent/Category.t - Notice 2 tests were run

Signed-off-by: daniel <daniel.barker.nz@gmail.com>
Made the requested changes.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 9 Katrin Fischer 2014-01-15 19:41:26 UTC
Created attachment 24423 [details] [review]
[PASSED QA] Bug 11543: (followup) Increasing test coverage for Category.pm

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 10 Galen Charlton 2014-01-15 19:59:15 UTC
Pushed to master.  Congratulations on having your first patch accepted into Koha, Roman!