|
Lines 760-766
subtest 'Holds test with start_date and end_date' => sub {
Link Here
|
| 760 |
|
760 |
|
| 761 |
subtest 'GetRecords' => sub { |
761 |
subtest 'GetRecords' => sub { |
| 762 |
|
762 |
|
| 763 |
plan tests => 8; |
763 |
plan tests => 10; |
| 764 |
|
764 |
|
| 765 |
$schema->storage->txn_begin; |
765 |
$schema->storage->txn_begin; |
| 766 |
|
766 |
|
|
Lines 825-830
subtest 'GetRecords' => sub {
Link Here
|
| 825 |
is($reply_reserve->{biblionumber}, $item->biblionumber, 'GetRecords has a reserve tag'); |
825 |
is($reply_reserve->{biblionumber}, $item->biblionumber, 'GetRecords has a reserve tag'); |
| 826 |
is($reply_reserve->{borrowernumber}, undef, 'GetRecords does not expose borrowernumber in reserve tag'); |
826 |
is($reply_reserve->{borrowernumber}, undef, 'GetRecords does not expose borrowernumber in reserve tag'); |
| 827 |
|
827 |
|
|
|
828 |
# Check for hidelostitems sys pref |
| 829 |
t::lib::Mocks::mock_preference( 'hidelostitems', 1 ); |
| 830 |
$item->itemlost(1)->store; |
| 831 |
$cgi->param( service => 'GetRecords' ); |
| 832 |
$cgi->param( id => $item->biblionumber ); |
| 833 |
my $itemlost_reply = C4::ILSDI::Services::GetRecords($cgi); |
| 834 |
is( |
| 835 |
$itemlost_reply->{record}->[0]->{items}->{item}->[0], undef, |
| 836 |
'GetRecords does not show lost items if hidelostitems = 1' |
| 837 |
); |
| 838 |
$item->itemlost(0)->store; |
| 839 |
|
| 840 |
# Check for OpacHiddenItems sys pref |
| 841 |
t::lib::Mocks::mock_preference( 'OpacHiddenItems', 'withdrawn: [1]' ); |
| 842 |
$item->withdrawn(1)->store; |
| 843 |
$cgi->param( service => 'GetRecords' ); |
| 844 |
$cgi->param( id => $item->biblionumber ); |
| 845 |
my $itemwithdrawn_reply = C4::ILSDI::Services::GetRecords($cgi); |
| 846 |
is( |
| 847 |
$itemwithdrawn_reply->{record}->[0]->{items}->{item}->[0], |
| 848 |
undef, |
| 849 |
'GetRecords does not show withdrawn items if OpacHiddenItems contains \'withdrawn: [1]\'' |
| 850 |
); |
| 851 |
|
| 828 |
$schema->storage->txn_rollback; |
852 |
$schema->storage->txn_rollback; |
| 829 |
}; |
853 |
}; |
| 830 |
|
854 |
|
| 831 |
- |
|
|