Lines 5-11
use Modern::Perl;
Link Here
|
5 |
use C4::Context; |
5 |
use C4::Context; |
6 |
use C4::Members; |
6 |
use C4::Members; |
7 |
|
7 |
|
8 |
use Test::More tests => 22; |
8 |
use Test::More tests => 31; |
9 |
|
9 |
|
10 |
use_ok('Koha::Borrower::Debarments'); |
10 |
use_ok('Koha::Borrower::Debarments'); |
11 |
|
11 |
|
Lines 86-95
is( @$debarments, 1, "GetDebarments returns 1 OVERDUES debarment after running A
Link Here
|
86 |
is( $debarments->[0]->{'expiration'}, '9999-11-09', "AddOverduesDebarment updated OVERDUES debarment correctly" ); |
86 |
is( $debarments->[0]->{'expiration'}, '9999-11-09', "AddOverduesDebarment updated OVERDUES debarment correctly" ); |
87 |
|
87 |
|
88 |
|
88 |
|
89 |
DelUniqueDebarment({ |
89 |
my $delUniqueDebarment = DelUniqueDebarment({ |
|
|
90 |
}); |
91 |
is( $delUniqueDebarment, undef, "DelUniqueDebarment without the arguments 'borrowernumber' and 'type' returns undef" ); |
92 |
$debarments = GetDebarments({ |
93 |
borrowernumber => $borrowernumber, |
94 |
type => 'OVERDUES', |
95 |
}); |
96 |
is( @$debarments, 1, "DelUniqueDebarment without the arguments 'borrowernumber' and 'type' does not delete the debarment" ); |
97 |
|
98 |
$delUniqueDebarment = DelUniqueDebarment({ |
99 |
borrowernumber => $borrowernumber, |
100 |
}); |
101 |
is( $delUniqueDebarment, undef, "DelUniqueDebarment without the argument 'type' returns undef" ); |
102 |
$debarments = GetDebarments({ |
103 |
borrowernumber => $borrowernumber, |
104 |
type => 'OVERDUES', |
105 |
}); |
106 |
is( @$debarments, 1, "DelUniqueDebarment without the argument 'type' does not delete the debarment" ); |
107 |
|
108 |
$delUniqueDebarment = DelUniqueDebarment({ |
109 |
type => 'OVERDUES' |
110 |
}); |
111 |
is( $delUniqueDebarment, undef, "DelUniqueDebarment without the argument 'borrowernumber' returns undef" ); |
112 |
$debarments = GetDebarments({ |
113 |
borrowernumber => $borrowernumber, |
114 |
type => 'OVERDUES', |
115 |
}); |
116 |
is( @$debarments, 1, "DelUniqueDebarment without the argument 'borrowerumber' does not delete the debarment" ); |
117 |
|
118 |
$delUniqueDebarment = DelUniqueDebarment({ |
119 |
borrowernumber => $borrowernumber, |
120 |
type => 'SUSPENSION', |
121 |
}); |
122 |
is( $delUniqueDebarment, undef, "DelUniqueDebarment with wrong arguments returns undef" ); |
123 |
$debarments = GetDebarments({ |
124 |
borrowernumber => $borrowernumber, |
125 |
type => 'OVERDUES', |
126 |
}); |
127 |
is( @$debarments, 1, "DelUniqueDebarment with wrong arguments does not delete the debarment" ); |
128 |
|
129 |
$delUniqueDebarment = DelUniqueDebarment({ |
90 |
borrowernumber => $borrowernumber, |
130 |
borrowernumber => $borrowernumber, |
91 |
type => 'OVERDUES', |
131 |
type => 'OVERDUES', |
92 |
}); |
132 |
}); |
|
|
133 |
is( $delUniqueDebarment, 1, "DelUniqueDebarment returns 1" ); |
93 |
$debarments = GetDebarments({ |
134 |
$debarments = GetDebarments({ |
94 |
borrowernumber => $borrowernumber, |
135 |
borrowernumber => $borrowernumber, |
95 |
type => 'OVERDUES', |
136 |
type => 'OVERDUES', |
96 |
- |
|
|