Bug 10694: (follow-up) remove truncate table from test case
[koha_fer] / t / db_dependent / Borrower_Debarments.t
index 9e2fd61..44d82b9 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-12-31'|); # Note: Change this test before the first of January 10000!
+is( IsDebarred( $borrowernumber ), '9999-12-31', 'A patron with a debarred date in the future is debarred' );
+
 $dbh->rollback;