|
Lines 19-30
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 5; |
22 |
use Test::More tests => 6; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
|
24 |
|
| 25 |
use C4::Reserves; |
25 |
use C4::Reserves; |
| 26 |
use Koha::AuthorisedValueCategory; |
26 |
use Koha::AuthorisedValueCategory; |
| 27 |
use Koha::Database; |
27 |
use Koha::Database; |
|
|
28 |
use Koha::DateUtils qw( dt_from_string ); |
| 28 |
use Koha::Holds; |
29 |
use Koha::Holds; |
| 29 |
|
30 |
|
| 30 |
use t::lib::Mocks; |
31 |
use t::lib::Mocks; |
|
Lines 408-413
subtest 'Desks' => sub {
Link Here
|
| 408 |
|
409 |
|
| 409 |
}; |
410 |
}; |
| 410 |
|
411 |
|
|
|
412 |
subtest 'set_waiting' => sub { |
| 413 |
|
| 414 |
plan tests => 1; |
| 415 |
|
| 416 |
subtest 'ReservesMaxPickUpDelay got removed' => sub { |
| 417 |
|
| 418 |
plan tests => 1; |
| 419 |
|
| 420 |
t::lib::Mocks::mock_preference('ReservesMaxPickUpDelay', undef); |
| 421 |
|
| 422 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 423 |
my $item = $builder->build_sample_item({ library => $library->branchcode }); |
| 424 |
my $manager = $builder->build_object( { class => "Koha::Patrons" } ); |
| 425 |
t::lib::Mocks::mock_userenv( { patron => $manager, branchcode => $manager->branchcode } ); |
| 426 |
|
| 427 |
my $patron = $builder->build_object( |
| 428 |
{ |
| 429 |
class => 'Koha::Patrons', |
| 430 |
value => { branchcode => $library->branchcode, } |
| 431 |
} |
| 432 |
); |
| 433 |
|
| 434 |
my $reserve_id = C4::Reserves::AddReserve( |
| 435 |
{ |
| 436 |
branchcode => $library->branchcode, |
| 437 |
borrowernumber => $patron->borrowernumber, |
| 438 |
biblionumber => $item->biblionumber, |
| 439 |
priority => 1, |
| 440 |
itemnumber => $item->itemnumber, |
| 441 |
} |
| 442 |
); |
| 443 |
|
| 444 |
my $hold = Koha::Holds->find($reserve_id); |
| 445 |
$hold->set_waiting; |
| 446 |
is( $hold->waitingdate, dt_from_string->ymd, 'If ReservesMaxPickUpDelay does not exist in DB, we should default to 0' ); |
| 447 |
}; |
| 448 |
}; |
| 449 |
|
| 411 |
$schema->storage->txn_rollback; |
450 |
$schema->storage->txn_rollback; |
| 412 |
|
451 |
|
| 413 |
1; |
452 |
1; |
| 414 |
- |
|
|