Lines 8-14
use C4::Items;
Link Here
|
8 |
use Koha::Items; |
8 |
use Koha::Items; |
9 |
use Koha::CirculationRules; |
9 |
use Koha::CirculationRules; |
10 |
|
10 |
|
11 |
use Test::More tests => 11; |
11 |
use Test::More tests => 12; |
12 |
|
12 |
|
13 |
use t::lib::TestBuilder; |
13 |
use t::lib::TestBuilder; |
14 |
use t::lib::Mocks; |
14 |
use t::lib::Mocks; |
Lines 393-398
subtest 'Check holds availability with different item types' => sub {
Link Here
|
393 |
is( $is, 1, "Item5 can be requested to hold, 2 items, Item4 checked out, Item5 restricted" ); |
393 |
is( $is, 1, "Item5 can be requested to hold, 2 items, Item4 checked out, Item5 restricted" ); |
394 |
}; |
394 |
}; |
395 |
|
395 |
|
|
|
396 |
subtest 'Check item checkout availability with ordered item' => sub { |
397 |
plan tests => 1; |
398 |
|
399 |
my $biblio2 = $builder->build_sample_biblio( { itemtype => $itemtype } ); |
400 |
my $biblionumber1 = $biblio2->biblionumber; |
401 |
my $item1 = $builder->build_sample_item( |
402 |
{ biblionumber => $biblionumber1, |
403 |
itype => $itemtype2, |
404 |
homebranch => $library_A, |
405 |
holdingbranch => $library_A, |
406 |
notforloan => -1 |
407 |
} |
408 |
); |
409 |
|
410 |
$dbh->do("DELETE FROM circulation_rules"); |
411 |
Koha::CirculationRules->set_rules( |
412 |
{ categorycode => undef, |
413 |
itemtype => $itemtype, |
414 |
branchcode => undef, |
415 |
rules => { |
416 |
issuelength => 7, |
417 |
lengthunit => 8, |
418 |
reservesallowed => 99, |
419 |
holds_per_record => 99, |
420 |
onshelfholds => 2, |
421 |
} |
422 |
} |
423 |
); |
424 |
|
425 |
$is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber1, patron => $patron1 } ); |
426 |
is( $is, 0, "Ordered item cannot be checked out" ); |
427 |
}; |
428 |
|
396 |
# Cleanup |
429 |
# Cleanup |
397 |
$schema->storage->txn_rollback; |
430 |
$schema->storage->txn_rollback; |
398 |
|
431 |
|
399 |
- |
|
|