Lines 227-247
subtest "store() tests" => sub {
Link Here
|
227 |
|
227 |
|
228 |
subtest "set_waiting() tests" => sub { |
228 |
subtest "set_waiting() tests" => sub { |
229 |
|
229 |
|
230 |
plan tests => 1; |
230 |
plan tests => 2; |
231 |
|
231 |
|
232 |
$schema->storage->txn_begin(); |
232 |
$schema->storage->txn_begin(); |
233 |
|
233 |
|
234 |
# Disable logging |
|
|
235 |
t::lib::Mocks::mock_preference( 'HoldsLog', 0 ); |
236 |
|
237 |
my $hold = $builder->build_object({ class => 'Koha::Holds' }); |
234 |
my $hold = $builder->build_object({ class => 'Koha::Holds' }); |
238 |
|
235 |
|
239 |
$hold->waitingdate('2021-01-01'); |
236 |
$hold->waitingdate('2021-01-01'); |
240 |
|
|
|
241 |
$hold->set_waiting(); |
237 |
$hold->set_waiting(); |
|
|
238 |
is($hold->waitingdate, '2021-01-01', "Setting waiting when already waiting should not update waitingdate"); |
242 |
|
239 |
|
243 |
is($hold->waitingdate,'2021-01-01',"Setting waiting when already waiting should not update waitingdate"); |
240 |
$hold->waitingdate(undef)->store; |
|
|
241 |
$hold->set_waiting(); |
242 |
isnt($hold->waitingdate, undef, "Setting waiting when not waiting already should update waitingdate"); |
244 |
|
243 |
|
|
|
244 |
$schema->storage->txn_rollback(); |
245 |
}; |
245 |
}; |
246 |
|
246 |
|
247 |
subtest "delete() tests" => sub { |
247 |
subtest "delete() tests" => sub { |
248 |
- |
|
|