|
Lines 229-236
subtest 'fill() tests' => sub {
Link Here
|
| 229 |
is( Koha::Old::Holds->find( $hold->id )->borrowernumber, |
229 |
is( Koha::Old::Holds->find( $hold->id )->borrowernumber, |
| 230 |
$patron->borrowernumber, 'Patron link is kept' ); |
230 |
$patron->borrowernumber, 'Patron link is kept' ); |
| 231 |
|
231 |
|
| 232 |
# 2 == delete immediately |
232 |
my $anonymous_patron = $builder->build_object({ class => 'Koha::Patrons' }); |
|
|
233 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous_patron->id ); |
| 234 |
# We need anonymous patron set to change patron privacy to never |
| 235 |
# (2 == delete immediately) |
| 236 |
# then we can undef for further tests |
| 233 |
$patron->privacy(2)->store; |
237 |
$patron->privacy(2)->store; |
|
|
238 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', undef ); |
| 234 |
$hold = $builder->build_object( |
239 |
$hold = $builder->build_object( |
| 235 |
{ |
240 |
{ |
| 236 |
class => 'Koha::Holds', |
241 |
class => 'Koha::Holds', |
|
Lines 247-253
subtest 'fill() tests' => sub {
Link Here
|
| 247 |
|
252 |
|
| 248 |
ok( !$hold->is_found, 'Hold is not filled' ); |
253 |
ok( !$hold->is_found, 'Hold is not filled' ); |
| 249 |
|
254 |
|
| 250 |
my $anonymous_patron = $builder->build_object({ class => 'Koha::Patrons' }); |
|
|
| 251 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous_patron->id ); |
255 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous_patron->id ); |
| 252 |
|
256 |
|
| 253 |
$hold = $builder->build_object( |
257 |
$hold = $builder->build_object( |
|
Lines 563-570
subtest 'cancel() tests' => sub {
Link Here
|
| 563 |
is( Koha::Old::Holds->find( $hold->id )->borrowernumber, |
567 |
is( Koha::Old::Holds->find( $hold->id )->borrowernumber, |
| 564 |
$patron->borrowernumber, 'Patron link is kept' ); |
568 |
$patron->borrowernumber, 'Patron link is kept' ); |
| 565 |
|
569 |
|
| 566 |
# 2 == delete immediately |
570 |
my $anonymous_patron = $builder->build_object({ class => 'Koha::Patrons' }); |
|
|
571 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous_patron->id ); |
| 572 |
# We need anonymous patron set to change patron privacy to never |
| 573 |
# (2 == delete immediately) |
| 574 |
# then we can undef for further tests |
| 567 |
$patron->privacy(2)->store; |
575 |
$patron->privacy(2)->store; |
|
|
576 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', undef ); |
| 568 |
$hold = $builder->build_object( |
577 |
$hold = $builder->build_object( |
| 569 |
{ |
578 |
{ |
| 570 |
class => 'Koha::Holds', |
579 |
class => 'Koha::Holds', |
|
Lines 580-586
subtest 'cancel() tests' => sub {
Link Here
|
| 580 |
|
589 |
|
| 581 |
ok( !$hold->is_found, 'Hold is not cancelled' ); |
590 |
ok( !$hold->is_found, 'Hold is not cancelled' ); |
| 582 |
|
591 |
|
| 583 |
my $anonymous_patron = $builder->build_object({ class => 'Koha::Patrons' }); |
|
|
| 584 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous_patron->id ); |
592 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous_patron->id ); |
| 585 |
|
593 |
|
| 586 |
$hold = $builder->build_object( |
594 |
$hold = $builder->build_object( |
| 587 |
- |
|
|