|
Lines 143-149
subtest 'set_pickup_location() tests' => sub {
Link Here
|
| 143 |
|
143 |
|
| 144 |
subtest 'is_pickup_location_valid() tests' => sub { |
144 |
subtest 'is_pickup_location_valid() tests' => sub { |
| 145 |
|
145 |
|
| 146 |
plan tests => 4; |
146 |
plan tests => 5; |
| 147 |
|
147 |
|
| 148 |
$schema->storage->txn_begin; |
148 |
$schema->storage->txn_begin; |
| 149 |
|
149 |
|
|
Lines 196-200
subtest 'is_pickup_location_valid() tests' => sub {
Link Here
|
| 196 |
ok( !$item_hold->is_pickup_location_valid({ library_id => $library_1->branchcode }), 'Pickup location invalid'); |
196 |
ok( !$item_hold->is_pickup_location_valid({ library_id => $library_1->branchcode }), 'Pickup location invalid'); |
| 197 |
ok( $item_hold->is_pickup_location_valid({ library_id => $library_2->id }), 'Pickup location valid' ); |
197 |
ok( $item_hold->is_pickup_location_valid({ library_id => $library_2->id }), 'Pickup location valid' ); |
| 198 |
|
198 |
|
|
|
199 |
# let's mock what Koha::Item->pickup_locations returns, for testing |
| 200 |
$mock_item->mock( 'pickup_locations', sub { |
| 201 |
return Koha::Libraries->new()->empty; |
| 202 |
}); |
| 203 |
ok( !$item_hold->is_pickup_location_valid({ library_id => $library_2->id }), 'Pickup location invalid' ); |
| 204 |
|
| 199 |
$schema->storage->txn_rollback; |
205 |
$schema->storage->txn_rollback; |
| 200 |
}; |
206 |
}; |
| 201 |
- |
|
|