Lines 6-12
use t::lib::Mocks;
Link Here
|
6 |
use C4::Context; |
6 |
use C4::Context; |
7 |
use C4::Branch; |
7 |
use C4::Branch; |
8 |
|
8 |
|
9 |
use Test::More tests => 25; |
9 |
use Test::More tests => 29; |
10 |
use MARC::Record; |
10 |
use MARC::Record; |
11 |
use C4::Biblio; |
11 |
use C4::Biblio; |
12 |
use C4::Items; |
12 |
use C4::Items; |
Lines 278-283
ModReserve({ reserve_id => $reserveid2, rank => 'del' });
Link Here
|
278 |
$reserve3 = GetReserve( $reserveid3 ); |
278 |
$reserve3 = GetReserve( $reserveid3 ); |
279 |
is( $reserve3->{priority}, 1, "After ModReserve, the 3rd reserve becomes the first on the waiting list" ); |
279 |
is( $reserve3->{priority}, 1, "After ModReserve, the 3rd reserve becomes the first on the waiting list" ); |
280 |
|
280 |
|
|
|
281 |
ModItem({ damaged => 1 }, $item_bibnum, $itemnumber); |
282 |
C4::Context->set_preference( 'AllowHoldsOnDamagedItems', 1 ); |
283 |
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber), "Patron can reserve damaged item with AllowHoldsOnDamagedItems enabled" ); |
284 |
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold can be trapped for damaged item with AllowHoldsOnDamagedItems enabled" ); |
285 |
C4::Context->set_preference( 'AllowHoldsOnDamagedItems', 0 ); |
286 |
ok( !CanItemBeReserved( $borrowernumbers[0], $itemnumber), "Patron cannot reserve damaged item with AllowHoldsOnDamagedItems disabled" ); |
287 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" ); |
288 |
|
281 |
|
289 |
|
282 |
# Helper method to set up a Biblio. |
290 |
# Helper method to set up a Biblio. |
283 |
sub create_helper_biblio { |
291 |
sub create_helper_biblio { |
284 |
- |
|
|