|
Lines 410-416
subtest 'Desks' => sub {
Link Here
|
| 410 |
}; |
410 |
}; |
| 411 |
|
411 |
|
| 412 |
subtest 'get_items_that_can_fill' => sub { |
412 |
subtest 'get_items_that_can_fill' => sub { |
| 413 |
plan tests => 3; |
413 |
plan tests => 4; |
| 414 |
|
414 |
|
| 415 |
my $biblio = $builder->build_sample_biblio; |
415 |
my $biblio = $builder->build_sample_biblio; |
| 416 |
my $itype_1 = $builder->build_object({ class => 'Koha::ItemTypes' }); # For 1, 2, 3, 4 |
416 |
my $itype_1 = $builder->build_object({ class => 'Koha::ItemTypes' }); # For 1, 2, 3, 4 |
|
Lines 502-507
subtest 'get_items_that_can_fill' => sub {
Link Here
|
| 502 |
is_deeply( [ map { $_->itemnumber } $items->as_list ], |
502 |
is_deeply( [ map { $_->itemnumber } $items->as_list ], |
| 503 |
[ $item_2->itemnumber ], 'Only item 2 is available for filling the hold' ); |
503 |
[ $item_2->itemnumber ], 'Only item 2 is available for filling the hold' ); |
| 504 |
|
504 |
|
|
|
505 |
|
| 506 |
my $noloan_itype = $builder->build_object( { class => 'Koha::ItemTypes', value => { notforloan => 1 } } ); |
| 507 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); |
| 508 |
Koha::Holds->find( $waiting_reserve_id )->delete; |
| 509 |
$holds = Koha::Holds->search( |
| 510 |
{ |
| 511 |
reserve_id => [ $reserve_id_1, $reserve_id_2 ] |
| 512 |
} |
| 513 |
); |
| 514 |
$items = $holds->get_items_that_can_fill; |
| 515 |
is_deeply( [ sort map { $_->itemnumber } $items->as_list ], |
| 516 |
[ $item_1->itemnumber, $item_2->itemnumber, $item_5->itemnumber ], 'Items 1, 2, and 5 are available for filling the holds' ); |
| 517 |
|
| 505 |
}; |
518 |
}; |
| 506 |
|
519 |
|
| 507 |
$schema->storage->txn_rollback; |
520 |
$schema->storage->txn_rollback; |
| 508 |
- |
|
|