Bugzilla – Attachment 29141 Details for
Bug 12416
DelUniqueDebarment (Debarments.pm) is not tested in Borrower_Debarments.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12416: add new tests of DelUniqueDebarment
SIGNED-OFF-Bug-12416-add-new-tests-of-DelUniqueDeb.patch (text/plain), 3.22 KB, created by
Bernardo Gonzalez Kriegel
on 2014-06-22 03:36:04 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12416: add new tests of DelUniqueDebarment
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-06-22 03:36:04 UTC
Size:
3.22 KB
patch
obsolete
>From 79e8496cec075786f830dbf9d406354b48c85b33 Mon Sep 17 00:00:00 2001 >From: Yohann Dufour <dufour.yohann@gmail.com> >Date: Mon, 16 Jun 2014 10:19:02 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 12416: add new tests of DelUniqueDebarment > >The subroutine DelUniqueDebarment was not enough tested > >To test: execute the command prove t/db_dependent/Borrower_Debarments.t >The command has to print: >t/db_dependent/Borrower_Debarments.t .. ok >All tests successful. >Files=1, Tests=31, 1 wallclock secs ( 0.03 usr 0.01 sys + 1.44 cusr 0.08 csys = 1.56 CPU) >Result: PASS > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >All 31 test pass, no koha-qa errors >--- > t/db_dependent/Borrower_Debarments.t | 45 ++++++++++++++++++++++++++++++++++-- > 1 file changed, 43 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Borrower_Debarments.t b/t/db_dependent/Borrower_Debarments.t >index 7b44f01..1c1d9bf 100755 >--- a/t/db_dependent/Borrower_Debarments.t >+++ b/t/db_dependent/Borrower_Debarments.t >@@ -5,7 +5,7 @@ use Modern::Perl; > use C4::Context; > use C4::Members; > >-use Test::More tests => 22; >+use Test::More tests => 31; > > use_ok('Koha::Borrower::Debarments'); > >@@ -86,10 +86,51 @@ is( @$debarments, 1, "GetDebarments returns 1 OVERDUES debarment after running A > is( $debarments->[0]->{'expiration'}, '9999-11-09', "AddOverduesDebarment updated OVERDUES debarment correctly" ); > > >-DelUniqueDebarment({ >+my $delUniqueDebarment = DelUniqueDebarment({ >+}); >+is( $delUniqueDebarment, undef, "DelUniqueDebarment without the arguments 'borrowernumber' and 'type' returns undef" ); >+$debarments = GetDebarments({ >+ borrowernumber => $borrowernumber, >+ type => 'OVERDUES', >+}); >+is( @$debarments, 1, "DelUniqueDebarment without the arguments 'borrowernumber' and 'type' does not delete the debarment" ); >+ >+$delUniqueDebarment = DelUniqueDebarment({ >+ borrowernumber => $borrowernumber, >+}); >+is( $delUniqueDebarment, undef, "DelUniqueDebarment without the argument 'type' returns undef" ); >+$debarments = GetDebarments({ >+ borrowernumber => $borrowernumber, >+ type => 'OVERDUES', >+}); >+is( @$debarments, 1, "DelUniqueDebarment without the argument 'type' does not delete the debarment" ); >+ >+$delUniqueDebarment = DelUniqueDebarment({ >+ type => 'OVERDUES' >+}); >+is( $delUniqueDebarment, undef, "DelUniqueDebarment without the argument 'borrowernumber' returns undef" ); >+$debarments = GetDebarments({ >+ borrowernumber => $borrowernumber, >+ type => 'OVERDUES', >+}); >+is( @$debarments, 1, "DelUniqueDebarment without the argument 'borrowerumber' does not delete the debarment" ); >+ >+$delUniqueDebarment = DelUniqueDebarment({ >+ borrowernumber => $borrowernumber, >+ type => 'SUSPENSION', >+}); >+is( $delUniqueDebarment, undef, "DelUniqueDebarment with wrong arguments returns undef" ); >+$debarments = GetDebarments({ >+ borrowernumber => $borrowernumber, >+ type => 'OVERDUES', >+}); >+is( @$debarments, 1, "DelUniqueDebarment with wrong arguments does not delete the debarment" ); >+ >+$delUniqueDebarment = DelUniqueDebarment({ > borrowernumber => $borrowernumber, > type => 'OVERDUES', > }); >+is( $delUniqueDebarment, 1, "DelUniqueDebarment returns 1" ); > $debarments = GetDebarments({ > borrowernumber => $borrowernumber, > type => 'OVERDUES', >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12416
:
28834
|
28859
|
28860
|
28861
|
29139
|
29140
|
29141
|
29148
|
29149
|
29150