View | Details | Raw Unified | Return to bug 27753
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-1 / +30 lines)
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
- 

Return to bug 27753