[Koha-bugs] [Bug 10653] UT : C4::RotatingCollections.pm needs unit tests.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Aug 5 10:45:33 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10653

--- Comment #6 from kenza <kenza.zaki at biblibre.com> ---
(In reply to kenza from comment #5)
> Created attachment 20106 [details] [review]
> Bug 10653: C4::RotatingCollections.pm needs unit tests
> 
> The tests are wrap in a database transaction.
> 
> Test plan:
> prove t/db_dependent/RotatingCollections.t
> t/db_dependent/RotatingCollections.t .. 1/41 attempting to use non-existent
> class sorting routine
> Use of uninitialized value $cn_class in concatenation (.) or string at
> C4/ClassSortRoutine.pm line 118.
> Use of uninitialized value $cn_item in concatenation (.) or string at
> C4/ClassSortRoutine.pm line 118.
> Use of uninitialized value $cn_class in concatenation (.) or string at
> C4/ClassSortRoutine.pm line 118.
> Use of uninitialized value $cn_item in concatenation (.) or string at
> C4/ClassSortRoutine.pm line 118.
> t/db_dependent/RotatingCollections.t .. ok
> All tests successful.
> Files=1, Tests=41,  2 wallclock secs ( 0.04 usr  0.02 sys +  0.99 cusr  0.08
> csys =  1.13 CPU)
> Result: PASS

I add the deletion of 'categories' ,'branches' and 'branchcategories'. It
should work but it still not:
if i do :
prove t/db_dependent/RotatingCollections.t 

t/db_dependent/RotatingCollections.t .. 1/41 DBD::mysql::db do failed: Cannot
delete or update a parent row: a foreign key constraint fails
(`koha`.`borrowers`, CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`)
REFERENCES `branches` (`branchcode`)) at t/db_dependent/RotatingCollections.t
line 41.
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key
constraint fails (`koha`.`borrowers`, CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY
(`branchcode`) REFERENCES `branches` (`branchcode`)) at
t/db_dependent/RotatingCollections.t line 41.
# Looks like you planned 41 tests but ran 2.
# Looks like your test exited with 255 just after 2.
t/db_dependent/RotatingCollections.t .. Dubious, test returned 255 (wstat
65280, 0xff00)
Failed 39/41 subtests 

Test Summary Report
-------------------
t/db_dependent/RotatingCollections.t (Wstat: 65280 Tests: 2 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 41 tests but ran 2.
Files=1, Tests=2,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.34 cusr  0.02
csys =  0.38 CPU)
Result: FAIL


But if i do:
 sudo prove t/db_dependent/RotatingCollections.t 
t/db_dependent/RotatingCollections.t .. 1/41 attempting to use non-existent
class sorting routine 
Use of uninitialized value $cn_class in concatenation (.) or string at
C4/ClassSortRoutine.pm line 118.
Use of uninitialized value $cn_item in concatenation (.) or string at
C4/ClassSortRoutine.pm line 118.
Use of uninitialized value $cn_class in concatenation (.) or string at
C4/ClassSortRoutine.pm line 118.
Use of uninitialized value $cn_item in concatenation (.) or string at
C4/ClassSortRoutine.pm line 118.
t/db_dependent/RotatingCollections.t .. ok     
All tests successful.
Files=1, Tests=41,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.37 cusr  0.00
csys =  0.39 CPU)
Result: PASS

I really don't understand ! So if someone has an idea which can help me...

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list