Lines 64-70
subtest 'hidden_in_opac() tests' => sub {
Link Here
|
64 |
|
64 |
|
65 |
subtest 'has_pending_hold() tests' => sub { |
65 |
subtest 'has_pending_hold() tests' => sub { |
66 |
|
66 |
|
67 |
plan tests => 3; |
67 |
plan tests => 2; |
68 |
|
68 |
|
69 |
$schema->storage->txn_begin; |
69 |
$schema->storage->txn_begin; |
70 |
|
70 |
|
Lines 73-84
subtest 'has_pending_hold() tests' => sub {
Link Here
|
73 |
my $itemnumber = $item->itemnumber; |
73 |
my $itemnumber = $item->itemnumber; |
74 |
|
74 |
|
75 |
# disable AllowItemsOnHoldCheckout as it ignores pending holds |
75 |
# disable AllowItemsOnHoldCheckout as it ignores pending holds |
76 |
t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 ); |
|
|
77 |
$dbh->do("INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',42,$itemnumber)"); |
76 |
$dbh->do("INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',42,$itemnumber)"); |
78 |
ok( $item->has_pending_hold, "Yes, we have a pending hold"); |
77 |
ok( $item->has_pending_hold, "Yes, we have a pending hold"); |
79 |
t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 1 ); |
|
|
80 |
ok( !$item->has_pending_hold, "We don't consider a pending hold if hold items can be checked out"); |
81 |
t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 ); |
82 |
$dbh->do("DELETE FROM tmp_holdsqueue WHERE itemnumber=$itemnumber"); |
78 |
$dbh->do("DELETE FROM tmp_holdsqueue WHERE itemnumber=$itemnumber"); |
83 |
ok( !$item->has_pending_hold, "We don't have a pending hold if nothing in the tmp_holdsqueue"); |
79 |
ok( !$item->has_pending_hold, "We don't have a pending hold if nothing in the tmp_holdsqueue"); |
84 |
}; |
80 |
}; |
85 |
- |
|
|