Bug 12416: add the test of DelUniqueDebarment

The subroutine DelUniqueDebarment was not 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=22,  2 wallclock secs ( 0.03 usr  0.01 sys +  1.43 cusr  0.07 csys =  1.54 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comments on last patch

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Yohann Dufour 2014-06-16 09:13:35 +02:00 committed by Tomas Cohen Arazi
parent 0f8ca14324
commit d27d88f809

View file

@ -5,7 +5,7 @@ use Modern::Perl;
use C4::Context;
use C4::Members;
use Test::More tests => 21;
use Test::More tests => 22;
use_ok('Koha::Borrower::Debarments');
@ -86,6 +86,17 @@ ok( @$debarments == 1, "GetDebarments returns 1 OVERDUES debarment after running
ok( $debarments->[0]->{'expiration'} eq '9999-11-09', "AddOverduesDebarment updated OVERDUES debarment correctly" );
DelUniqueDebarment({
borrowernumber => $borrowernumber,
type => 'OVERDUES',
});
$debarments = GetDebarments({
borrowernumber => $borrowernumber,
type => 'OVERDUES',
});
is( @$debarments, 0, "DelUniqueDebarment functions correctly" );
$debarments = GetDebarments({ borrowernumber => $borrowernumber });
foreach my $d ( @$debarments ) {
DelDebarment( $d->{'borrower_debarment_id'} );