Bug 12134: (follow-up) add more unit tests to reflect the change in IsDebarred
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 25 Apr 2014 10:48:42 +0000 (12:48 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 28 Apr 2014 17:04:39 +0000 (17:04 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/db_dependent/Borrower_Debarments.t

index 9e2fd61..cb71c57 100755 (executable)
@@ -5,7 +5,7 @@ use Modern::Perl;
 use C4::Context;
 use C4::Members;
 
-use Test::More tests => 19;
+use Test::More tests => 21;
 
 use_ok('Koha::Borrower::Debarments');
 
@@ -96,4 +96,10 @@ ok( @$debarments == 0, "DelDebarment functions correctly" );
 $dbh->do(q|UPDATE borrowers SET debarred = '1970-01-01'|);
 is( IsDebarred( $borrowernumber ), undef, 'A patron with a debarred date in the past is not debarred' );
 
+$dbh->do(q|UPDATE borrowers SET debarred = NULL|);
+is( IsDebarred( $borrowernumber ), undef, 'A patron without a debarred date is not debarred' );
+
+$dbh->do(q|UPDATE borrowers SET debarred = '9999-31-12'|); # Note: Change this test before the first of January 10000!
+is( IsDebarred( $borrowernumber ), undef, 'A patron with a debarred date in the future is debarred' );
+
 $dbh->rollback;