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