Bug 11543 - Increasing test coverage for C4::Category
Summary: Increasing test coverage for C4::Category
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Chris Cormack
QA Contact: Galen Charlton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 01:14 UTC by Roman Amor
Modified: 2014-12-07 20:07 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Proposed patch (723 bytes, patch)
2014-01-14 01:27 UTC, Roman Amor
Details | Diff | Splinter Review
Bug 11543: Increasing test coverage for Category.pm (769 bytes, patch)
2014-01-14 02:27 UTC, Daniel Barker
Details | Diff | Splinter Review
Bug 11543: Increasing test coverage for Category.pm (769 bytes, patch)
2014-01-14 02:27 UTC, Daniel Barker
Details | Diff | Splinter Review
Bug 11543: Increasing test coverage for Category.pm (1.85 KB, patch)
2014-01-14 21:16 UTC, Roman Amor
Details | Diff | Splinter Review
Bug 11543: Increasing test coverage for Category.pm (1.91 KB, patch)
2014-01-15 17:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11543: (followup) Increasing test coverage for Category.pm (1.99 KB, patch)
2014-01-15 17:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 11543: Increasing test coverage for Category.pm (1.97 KB, patch)
2014-01-15 19:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11543: (followup) Increasing test coverage for Category.pm (2.05 KB, patch)
2014-01-15 19:41 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (khall) 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!