Bug 12134: (follow-up) add more unit tests to reflect the change in IsDebarred

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c2d0a49def)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2014-04-25 12:48:42 +02:00 committed by Fridolin Somers
parent 10bb2dea27
commit 1d4d2d0db7
1 changed files with 7 additions and 1 deletions

View File

@ -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;