Lines 313-330
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 |
316 |
#place item into holds queue |
318 |
my $dbh = C4::Context->dbh; |
317 |
my $dbh = C4::Context->dbh; |
|
|
318 |
@results = GetItemsInfo( $biblio->biblionumber ); |
319 |
is( $results[0]->{ has_pending_hold }, "0", |
320 |
'Hold not marked as pending/unavailable if nothing in tmp_holdsqueue for item' ); |
321 |
|
319 |
$dbh->do(q{INSERT INTO tmp_holdsqueue (biblionumber, itemnumber, surname, borrowernumber ) VALUES (?, ?, "Zorro", 42)}, undef, $item_bibnum, $itemnumber); |
322 |
$dbh->do(q{INSERT INTO tmp_holdsqueue (biblionumber, itemnumber, surname, borrowernumber ) VALUES (?, ?, "Zorro", 42)}, undef, $item_bibnum, $itemnumber); |
320 |
@results = GetItemsInfo( $biblio->biblionumber ); |
323 |
@results = GetItemsInfo( $biblio->biblionumber ); |
321 |
is( $results[0]->{ has_pending_hold }, "1", |
324 |
is( $results[0]->{ has_pending_hold }, "1", |
322 |
'Hold marked as pending/unavailable if not AllowItemsOnHoldCheckout' ); |
325 |
'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]->{ has_pending_hold }, undef, |
326 |
'Hold not marked as pending/unavailable if AllowItemsOnHoldCheckout' ); |
327 |
|
328 |
|
326 |
|
329 |
$schema->storage->txn_rollback; |
327 |
$schema->storage->txn_rollback; |
330 |
}; |
328 |
}; |
331 |
- |
|
|