Lines 7-13
use t::lib::TestBuilder;
Link Here
|
7 |
|
7 |
|
8 |
use C4::Context; |
8 |
use C4::Context; |
9 |
|
9 |
|
10 |
use Test::More tests => 75; |
10 |
use Test::More tests => 76; |
11 |
use Test::Exception; |
11 |
use Test::Exception; |
12 |
|
12 |
|
13 |
use MARC::Record; |
13 |
use MARC::Record; |
Lines 384-389
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1' );
Link Here
|
384 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); |
384 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); |
385 |
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1|1' ); |
385 |
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1|1' ); |
386 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); |
386 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); |
|
|
387 |
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '' ); |
388 |
my $item_group_1 = Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); |
389 |
my $item_group_2 = Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); |
390 |
$item_group_1->add_item({ item_id => $itemnumber }); |
391 |
$hold->item_group_id( $item_group_2->id )->update; |
392 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with non-matching item group" ); |
387 |
is( |
393 |
is( |
388 |
CanItemBeReserved( $patrons[0], $nfl_item)->{status}, 'itemAlreadyOnHold', |
394 |
CanItemBeReserved( $patrons[0], $nfl_item)->{status}, 'itemAlreadyOnHold', |
389 |
"cannot request item that you have already reservedd" |
395 |
"cannot request item that you have already reservedd" |
390 |
- |
|
|