Lines 250-256
subtest 'GetHiddenItemnumbers tests' => sub {
Link Here
|
250 |
|
250 |
|
251 |
subtest 'GetItemsInfo tests' => sub { |
251 |
subtest 'GetItemsInfo tests' => sub { |
252 |
|
252 |
|
253 |
plan tests => 4; |
253 |
plan tests => 6; |
254 |
|
254 |
|
255 |
$schema->storage->txn_begin; |
255 |
$schema->storage->txn_begin; |
256 |
|
256 |
|
Lines 294-299
subtest 'GetItemsInfo tests' => sub {
Link Here
|
294 |
is( exists( $results[0]->{ onsite_checkout } ), 1, |
294 |
is( exists( $results[0]->{ onsite_checkout } ), 1, |
295 |
'GetItemsInfo returns a onsite_checkout key' ); |
295 |
'GetItemsInfo returns a onsite_checkout key' ); |
296 |
|
296 |
|
|
|
297 |
t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 ); |
298 |
#place item into holds queue |
299 |
my $dbh = C4::Context->dbh; |
300 |
$dbh->do(q{INSERT INTO tmp_holdsqueue (biblionumber, itemnumber, surname, borrowernumber ) VALUES (?, ?, "Zorro", 42)}, undef, $item_bibnum, $itemnumber); |
301 |
@results = GetItemsInfo( $biblionumber ); |
302 |
is( $results[0]->{ pending_hold }, "1", |
303 |
'Hold marked as pending/unavailable if not AllowItemsOnHoldCheckout' ); |
304 |
t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 1 ); |
305 |
@results = GetItemsInfo( $biblionumber ); |
306 |
is( $results[0]->{ pending_hold }, undef, |
307 |
'Hold not marked as pending/unavailable if AllowItemsOnHoldCheckout' ); |
308 |
|
309 |
|
297 |
$schema->storage->txn_rollback; |
310 |
$schema->storage->txn_rollback; |
298 |
}; |
311 |
}; |
299 |
|
312 |
|
300 |
- |
|
|