Lines 636-644
subtest 'SearchItems test' => sub {
Link Here
|
636 |
AddIssue( $patron_borrower, $item1->barcode ); |
636 |
AddIssue( $patron_borrower, $item1->barcode ); |
637 |
# Search item where item is checked out |
637 |
# Search item where item is checked out |
638 |
$filter = { |
638 |
$filter = { |
639 |
field => 'onloan', |
639 |
conjunction => 'AND', |
640 |
query => 'not null', |
640 |
filters => [ |
641 |
operator => 'is', |
641 |
{ |
|
|
642 |
field => 'onloan', |
643 |
query => 'not null', |
644 |
operator => 'is', |
645 |
}, |
646 |
{ |
647 |
field => 'homebranch', |
648 |
query => $item1->homebranch, |
649 |
operator => '=', |
650 |
}, |
651 |
], |
642 |
}; |
652 |
}; |
643 |
($items, $total_results) = SearchItems($filter); |
653 |
($items, $total_results) = SearchItems($filter); |
644 |
ok(scalar @$items == 1, 'found 1 checked out item'); |
654 |
ok(scalar @$items == 1, 'found 1 checked out item'); |
Lines 648-654
subtest 'SearchItems test' => sub {
Link Here
|
648 |
sortby => 'availability', |
658 |
sortby => 'availability', |
649 |
sortorder => 'DESC', |
659 |
sortorder => 'DESC', |
650 |
}; |
660 |
}; |
651 |
($items, $total_results) = SearchItems(undef,$params); |
661 |
$filter = { |
|
|
662 |
field => 'homebranch', |
663 |
query => $item1->homebranch, |
664 |
operator => '=', |
665 |
}; |
666 |
($items, $total_results) = SearchItems($filter,$params); |
652 |
is($items->[0]->{barcode}, $item1->barcode, 'Items sorted as expected by availability'); |
667 |
is($items->[0]->{barcode}, $item1->barcode, 'Items sorted as expected by availability'); |
653 |
|
668 |
|
654 |
$schema->storage->txn_rollback; |
669 |
$schema->storage->txn_rollback; |
655 |
- |
|
|