Lines 2636-2665
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
Link Here
|
2636 |
subtest "Bug 27753 - Add AutoClaimReturnStatusOnCheckin" => sub { |
2636 |
subtest "Bug 27753 - Add AutoClaimReturnStatusOnCheckin" => sub { |
2637 |
plan tests => 8; |
2637 |
plan tests => 8; |
2638 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); |
2638 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); |
2639 |
t::lib::Mocks::mock_userenv({ branchcode => $library2->{branchcode} }); |
2639 |
t::lib::Mocks::mock_userenv( { branchcode => $library2->{branchcode} } ); |
2640 |
t::lib::Mocks::mock_preference( 'ClaimReturnedLostValue', 1 ); |
2640 |
t::lib::Mocks::mock_preference( 'ClaimReturnedLostValue', 1 ); |
2641 |
t::lib::Mocks::mock_preference( 'AutoClaimReturnStatusOnCheckin', 1 ); |
2641 |
t::lib::Mocks::mock_preference( 'AutoClaimReturnStatusOnCheckin', 1 ); |
2642 |
my $item = $builder->build_sample_item ({library=>$library2->{branchcode}}); |
2642 |
my $item = $builder->build_sample_item( { library => $library2->{branchcode} } ); |
2643 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
2643 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
2644 |
my $checkout = AddIssue( $patron, $item->barcode ); |
2644 |
my $checkout = AddIssue( $patron, $item->barcode ); |
2645 |
|
2645 |
|
2646 |
my $claim = $checkout->claim_returned( |
2646 |
my $claim = $checkout->claim_returned( |
2647 |
{ |
2647 |
{ |
2648 |
created_by => $patron->id, |
2648 |
created_by => $patron->id, |
2649 |
notes => "Test note", |
2649 |
notes => "Test note", |
2650 |
} |
2650 |
} |
2651 |
); |
2651 |
); |
2652 |
is( $claim->issue_id, $checkout->id, "Claim issue id matches" ); |
2652 |
is( $claim->issue_id, $checkout->id, "Claim issue id matches" ); |
2653 |
is( $claim->itemnumber, $item->id, "Claim itemnumber matches" ); |
2653 |
is( $claim->itemnumber, $item->id, "Claim itemnumber matches" ); |
2654 |
is( $claim->borrowernumber, $patron->id, "Claim borrowernumber matches" ); |
2654 |
is( $claim->borrowernumber, $patron->id, "Claim borrowernumber matches" ); |
2655 |
is( $claim->notes, "Test note", "Claim notes match" ); |
2655 |
is( $claim->notes, "Test note", "Claim notes match" ); |
2656 |
is( $claim->created_by, $patron->id, "Claim created_by matches" ); |
2656 |
is( $claim->created_by, $patron->id, "Claim created_by matches" ); |
2657 |
ok( $claim->created_on, "Claim created_on is set" ); |
2657 |
ok( $claim->created_on, "Claim created_on is set" ); |
2658 |
|
2658 |
|
2659 |
my ( $doreturn, $messages) = AddReturn ( $item->barcode, $library->{branchcode} ); |
2659 |
my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode} ); |
2660 |
is (ref $messages->{ClaimAutoResolved}, 'Koha::Checkouts::ReturnClaim', "Claim auto resolved upon checkin"); |
2660 |
is( ref $messages->{ClaimAutoResolved}, 'Koha::Checkouts::ReturnClaim', "Claim auto resolved upon checkin" ); |
2661 |
$claim->discard_changes; |
2661 |
$claim->discard_changes; |
2662 |
ok( $claim->resolved_by, "Claim is resolved"); |
2662 |
ok( $claim->resolved_by, "Claim is resolved" ); |
2663 |
}; |
2663 |
}; |
2664 |
|
2664 |
|
2665 |
subtest 'MultipleReserves' => sub { |
2665 |
subtest 'MultipleReserves' => sub { |
2666 |
- |
|
|