Lines 20-26
Link Here
|
20 |
use Carp::Always; |
20 |
use Carp::Always; |
21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
22 |
|
22 |
|
23 |
use Test::More tests => 37; |
23 |
use Test::More tests => 38; |
24 |
use t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
25 |
|
25 |
|
26 |
use C4::Reserves qw( GetMaxPatronHoldsForRecord AddReserve CanBookBeReserved ); |
26 |
use C4::Reserves qw( GetMaxPatronHoldsForRecord AddReserve CanBookBeReserved ); |
Lines 231-236
$rule3->delete();
Link Here
|
231 |
$rule4->delete(); |
231 |
$rule4->delete(); |
232 |
$rule5->delete(); |
232 |
$rule5->delete(); |
233 |
|
233 |
|
|
|
234 |
my $holds = Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } ); |
235 |
is( $holds->forced_hold_level, undef, "No holds does not force an item or record level hold" ); |
236 |
|
234 |
# Test Koha::Holds::forced_hold_level |
237 |
# Test Koha::Holds::forced_hold_level |
235 |
my $hold = Koha::Hold->new({ |
238 |
my $hold = Koha::Hold->new({ |
236 |
borrowernumber => $patron->{borrowernumber}, |
239 |
borrowernumber => $patron->{borrowernumber}, |
Lines 240-246
my $hold = Koha::Hold->new({
Link Here
|
240 |
priority => 1, |
243 |
priority => 1, |
241 |
})->store(); |
244 |
})->store(); |
242 |
|
245 |
|
243 |
my $holds = Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } ); |
246 |
$holds = Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } ); |
244 |
is( $holds->forced_hold_level, 'record', "Record level hold forces record level holds" ); |
247 |
is( $holds->forced_hold_level, 'record', "Record level hold forces record level holds" ); |
245 |
|
248 |
|
246 |
$hold->itemnumber( $item1->{itemnumber} ); |
249 |
$hold->itemnumber( $item1->{itemnumber} ); |
247 |
- |
|
|