|
Lines 286-292
subtest 'Handle ids duplication' => sub {
Link Here
|
| 286 |
}; |
286 |
}; |
| 287 |
|
287 |
|
| 288 |
subtest 'BlockReturnOfLostItems' => sub { |
288 |
subtest 'BlockReturnOfLostItems' => sub { |
| 289 |
plan tests => 4; |
289 |
plan tests => 5; |
| 290 |
my $item = $builder->build_sample_item; |
290 |
my $item = $builder->build_sample_item; |
| 291 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
291 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 292 |
my $checkout = AddIssue( $patron, $item->barcode ); |
292 |
my $checkout = AddIssue( $patron, $item->barcode ); |
|
Lines 298-303
subtest 'BlockReturnOfLostItems' => sub {
Link Here
|
| 298 |
my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode); |
298 |
my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode); |
| 299 |
is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked"); |
299 |
is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked"); |
| 300 |
is( $messages->{WasLost}, 1, "... and the WasLost flag should be set"); |
300 |
is( $messages->{WasLost}, 1, "... and the WasLost flag should be set"); |
|
|
301 |
is( $messages->{NeedsTransfer}, undef, "... and no transfer should be triggered"); |
| 301 |
|
302 |
|
| 302 |
$item->discard_changes; |
303 |
$item->discard_changes; |
| 303 |
is( $item->itemlost, 1, "Item remains lost" ); |
304 |
is( $item->itemlost, 1, "Item remains lost" ); |
| 304 |
- |
|
|