Bug 12417

Summary: Koha::Borrower::Files.pm needs unit tests
Product: Koha Reporter: Yohann Dufour <yohann.dufour>
Component: Test SuiteAssignee: Yohann Dufour <yohann.dufour>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: normal    
Priority: P5 - low CC: bgkriegel, tomascohen
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:
Circulation function:
Attachments: Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm
[SIGNED-OFF] Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm
Bug 12417: Allow execution of UTs on a DB with issues
[SIGNED-OFF] Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm
[PASSED QA] Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm

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 (khall) 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 (tcohen) 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.