Lines 251-257
subtest 'GetHiddenItemnumbers tests' => sub {
Link Here
|
251 |
|
251 |
|
252 |
subtest 'GetItemsInfo tests' => sub { |
252 |
subtest 'GetItemsInfo tests' => sub { |
253 |
|
253 |
|
254 |
plan tests => 7; |
254 |
plan tests => 9; |
255 |
|
255 |
|
256 |
$schema->storage->txn_begin; |
256 |
$schema->storage->txn_begin; |
257 |
|
257 |
|
Lines 313-318
subtest 'GetItemsInfo tests' => sub {
Link Here
|
313 |
is( $results[0]->{ restrictedvalueopac }, "Restricted Access OPAC", |
313 |
is( $results[0]->{ restrictedvalueopac }, "Restricted Access OPAC", |
314 |
'GetItemsInfo returns a restricted value description (OPAC)' ); |
314 |
'GetItemsInfo returns a restricted value description (OPAC)' ); |
315 |
|
315 |
|
|
|
316 |
t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 ); |
317 |
#place item into holds queue |
318 |
my $dbh = C4::Context->dbh; |
319 |
$dbh->do(q{INSERT INTO tmp_holdsqueue (biblionumber, itemnumber, surname, borrowernumber ) VALUES (?, ?, "Zorro", 42)}, undef, $item_bibnum, $itemnumber); |
320 |
@results = GetItemsInfo( $biblio->biblionumber ); |
321 |
is( $results[0]->{ pending_hold }, "1", |
322 |
'Hold marked as pending/unavailable if not AllowItemsOnHoldCheckout' ); |
323 |
t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 1 ); |
324 |
@results = GetItemsInfo( $biblio->biblionumber ); |
325 |
is( $results[0]->{ pending_hold }, undef, |
326 |
'Hold not marked as pending/unavailable if AllowItemsOnHoldCheckout' ); |
327 |
|
328 |
|
316 |
$schema->storage->txn_rollback; |
329 |
$schema->storage->txn_rollback; |
317 |
}; |
330 |
}; |
318 |
|
331 |
|
319 |
- |
|
|