|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 5; |
20 |
use Test::More tests => 6; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Warn; |
22 |
use Test::Warn; |
| 23 |
|
23 |
|
|
Lines 364-367
subtest 'Checkin of an item claimed as returned should generate a message' => su
Link Here
|
| 364 |
ok( $messages->{ReturnClaims}, "ReturnClaims is in messages for return of a claimed as returned itm" ); |
364 |
ok( $messages->{ReturnClaims}, "ReturnClaims is in messages for return of a claimed as returned itm" ); |
| 365 |
}; |
365 |
}; |
| 366 |
|
366 |
|
|
|
367 |
subtest 'BranchTransferLimitsType' => sub { |
| 368 |
plan tests => 2; |
| 369 |
|
| 370 |
t::lib::Mocks::mock_preference('AutomaticItemReturn', 0); |
| 371 |
t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1); |
| 372 |
t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'ccode'); |
| 373 |
|
| 374 |
my $biblio = $builder->build_object( { class => 'Koha::Biblios' } ); |
| 375 |
my $item = $builder->build_object( |
| 376 |
{ |
| 377 |
class => 'Koha::Items', |
| 378 |
value => { |
| 379 |
biblionumber => $biblio->biblionumber, |
| 380 |
notforloan => 0, |
| 381 |
itemlost => 0, |
| 382 |
withdrawn => 0, |
| 383 |
} |
| 384 |
} |
| 385 |
); |
| 386 |
my $patron = $builder->build_object({class => 'Koha::Patrons'}); |
| 387 |
my $checkout = AddIssue( $patron->unblessed, $item->barcode ); |
| 388 |
my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode); |
| 389 |
is( $doreturn, 1, 'AddReturn should have checkin the item if BranchTransferLimitsType=ccode'); |
| 390 |
|
| 391 |
t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype'); |
| 392 |
$checkout = AddIssue( $patron->unblessed, $item->barcode ); |
| 393 |
( $doreturn, $messages, $issue ) = AddReturn($item->barcode); |
| 394 |
is( $doreturn, 1, 'AddReturn should have checkin the item if BranchTransferLimitsType=itemtype'); |
| 395 |
}; |
| 396 |
|
| 367 |
$schema->storage->txn_rollback; |
397 |
$schema->storage->txn_rollback; |
| 368 |
- |
|
|