|
Lines 18-24
Link Here
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
use utf8; |
19 |
use utf8; |
| 20 |
|
20 |
|
| 21 |
use Test::More tests => 70; |
21 |
use Test::More tests => 71; |
| 22 |
use Test::Exception; |
22 |
use Test::Exception; |
| 23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
| 24 |
use Test::Deep qw( cmp_deeply ); |
24 |
use Test::Deep qw( cmp_deeply ); |
|
Lines 2590-2595
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
Link Here
|
| 2590 |
# TODO There are other tests to provide here |
2590 |
# TODO There are other tests to provide here |
| 2591 |
}; |
2591 |
}; |
| 2592 |
|
2592 |
|
|
|
2593 |
|
| 2594 |
subtest "Bug 27753 - Add AutoClaimReturnStatusOnCheckin" => sub { |
| 2595 |
plan tests => 8; |
| 2596 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); |
| 2597 |
t::lib::Mocks::mock_userenv({ branchcode => $library2->{branchcode} }); |
| 2598 |
t::lib::Mocks::mock_preference( 'ClaimReturnedLostValue', 1 ); |
| 2599 |
t::lib::Mocks::mock_preference( 'AutoClaimReturnStatusOnCheckin', 1 ); |
| 2600 |
my $item = $builder->build_sample_item ({library=>$library2->{branchcode}}); |
| 2601 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 2602 |
my $checkout = AddIssue( $patron, $item->barcode ); |
| 2603 |
|
| 2604 |
my $claim = $checkout->claim_returned( |
| 2605 |
{ |
| 2606 |
created_by => $patron->id, |
| 2607 |
notes => "Test note", |
| 2608 |
} |
| 2609 |
); |
| 2610 |
is( $claim->issue_id, $checkout->id, "Claim issue id matches" ); |
| 2611 |
is( $claim->itemnumber, $item->id, "Claim itemnumber matches" ); |
| 2612 |
is( $claim->borrowernumber, $patron->id, "Claim borrowernumber matches" ); |
| 2613 |
is( $claim->notes, "Test note", "Claim notes match" ); |
| 2614 |
is( $claim->created_by, $patron->id, "Claim created_by matches" ); |
| 2615 |
ok( $claim->created_on, "Claim created_on is set" ); |
| 2616 |
|
| 2617 |
my ( $doreturn, $messages) = AddReturn ( $item->barcode, $library->{branchcode} ); |
| 2618 |
is (ref $messages->{ClaimAutoResolved}, 'Koha::Checkouts::ReturnClaim', "Claim auto resolved upon checkin"); |
| 2619 |
$claim->discard_changes; |
| 2620 |
ok( $claim->resolved_by, "Claim is resolved"); |
| 2621 |
}; |
| 2622 |
|
| 2593 |
subtest 'MultipleReserves' => sub { |
2623 |
subtest 'MultipleReserves' => sub { |
| 2594 |
plan tests => 3; |
2624 |
plan tests => 3; |
| 2595 |
|
2625 |
|
| 2596 |
- |
|
|