|
Lines 337-343
subtest 'Handle ids duplication' => sub {
Link Here
|
| 337 |
}; |
337 |
}; |
| 338 |
|
338 |
|
| 339 |
subtest 'BlockReturnOfLostItems' => sub { |
339 |
subtest 'BlockReturnOfLostItems' => sub { |
| 340 |
plan tests => 3; |
340 |
plan tests => 4; |
| 341 |
my $biblio = $builder->build_object( { class => 'Koha::Biblios' } ); |
341 |
my $biblio = $builder->build_object( { class => 'Koha::Biblios' } ); |
| 342 |
my $item = $builder->build_object( |
342 |
my $item = $builder->build_object( |
| 343 |
{ |
343 |
{ |
|
Lines 361-366
subtest 'BlockReturnOfLostItems' => sub {
Link Here
|
| 361 |
is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked"); |
361 |
is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked"); |
| 362 |
is( $messages->{WasLost}, 1, "... and the WasLost flag should be set"); |
362 |
is( $messages->{WasLost}, 1, "... and the WasLost flag should be set"); |
| 363 |
|
363 |
|
|
|
364 |
$item->discard_changes; |
| 365 |
is( $item->itemlost, 1, "Item remains lost" ); |
| 366 |
|
| 364 |
t::lib::Mocks::mock_preference('BlockReturnOfLostItems', 0); |
367 |
t::lib::Mocks::mock_preference('BlockReturnOfLostItems', 0); |
| 365 |
( $doreturn, $messages, $issue ) = AddReturn($item->barcode); |
368 |
( $doreturn, $messages, $issue ) = AddReturn($item->barcode); |
| 366 |
is( $doreturn, 1, "Without BlockReturnOfLostItems, a checkin of a lost item should not be blocked"); |
369 |
is( $doreturn, 1, "Without BlockReturnOfLostItems, a checkin of a lost item should not be blocked"); |
| 367 |
- |
|
|