From 29cf8aeeb7e884b4114ad121568be042a87c3d9c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 25 Apr 2014 12:48:42 +0200 Subject: [PATCH] Bug 12134: (follow-up) Add unit tests to reflect the change in IsDebarred Signed-off-by: Jonathan Druart --- t/db_dependent/Borrower_Debarments.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Borrower_Debarments.t b/t/db_dependent/Borrower_Debarments.t index 9e2fd61..cb71c57 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 => 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; -- 1.7.10.4