Bug 12417 - Koha::Borrower::Files.pm needs unit tests
Summary: Koha::Borrower::Files.pm needs unit tests
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Yohann Dufour
QA Contact: Galen Charlton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-13 10:10 UTC by Yohann Dufour
Modified: 2015-06-04 23:30 UTC (History)
3 users (show)

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


Attachments
Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm (4.70 KB, patch)
2014-06-16 11:50 UTC, Yohann Dufour
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm (4.82 KB, patch)
2014-06-22 23:56 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 12417: Allow execution of UTs on a DB with issues (710 bytes, patch)
2014-06-24 08:04 UTC, Yohann Dufour
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm (4.86 KB, patch)
2014-07-09 15:31 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm (4.93 KB, patch)
2014-07-11 15:29 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Yohann Dufour 2014-06-13 10:10:43 UTC
The module Koha::Borrower::Files.pm is not tested
Comment 1 Yohann Dufour 2014-06-16 11:50:40 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2014-06-22 23:56:19 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-06-24 04:47:35 UTC
The tests fail for me, because I have borrowers with issues in my database I think:

ok 1 - use Koha::Borrower::Files;
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha`.`issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE) at t/db_dependent/Borrower_Files.t line 33.
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha`.`issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE) at t/db_dependent/Borrower_Files.t line 33.

Maybe the tests can be improved a bit to make this not a problem?
Comment 4 Yohann Dufour 2014-06-24 08:04:44 UTC Comment hidden (obsolete)
Comment 5 Bernardo Gonzalez Kriegel 2014-07-09 15:31:13 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2014-07-11 15:29:50 UTC
Created attachment 29645 [details] [review]
[PASSED QA] Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm

The module Koha::Borrower::Files.pm was not tested

To test:
1/ Execute the command: prove t/db_dependent/Borrower_Files.t
2/ The command has to print:
t/db_dependent/Borrower_Files.t .. ok
All tests successful.
Files=1, Tests=23,  2 wallclock secs ( 0.04 usr  0.01 sys +  1.47 cusr  0.08 csys =  1.60 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Squashed patches.
Now test pass
No koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Tomás Cohen Arazi 2014-07-11 19:30:04 UTC
Patch pushed to master.

Thanks Yohann!
Comment 8 Galen Charlton 2014-07-23 21:35:49 UTC
Pushed to 3.16.x for inclusion in 3.16.2.