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