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

(-)a/t/db_dependent/Circulation/Returns.t (-2 / +31 lines)
Lines 1-5 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
use Test::More tests => 2;
2
3
use Test::More tests => 3;
3
4
4
use t::lib::Mocks;
5
use t::lib::Mocks;
5
use C4::Biblio;
6
use C4::Biblio;
Lines 8-13 use C4::Items; Link Here
8
use C4::Members;
9
use C4::Members;
9
use Koha::Database;
10
use Koha::Database;
10
use Koha::DateUtils;
11
use Koha::DateUtils;
12
use Koha::OldIssues;
11
13
12
use t::lib::TestBuilder;
14
use t::lib::TestBuilder;
13
15
Lines 56-58 is( $item->{location}, 'TEST', "InProcessingToShelvingCart functions as intended Link Here
56
sub Mock_userenv {
58
sub Mock_userenv {
57
    return { branch => $library->{branchcode} };
59
    return { branch => $library->{branchcode} };
58
}
60
}
59
- 
61
62
subtest 'Handle ids duplication' => sub {
63
    plan tests => 1;
64
65
    my $biblio = $builder->build( { source => 'Biblio' } );
66
    my $item = $builder->build(
67
        {
68
            source => 'Item',
69
            value  => {
70
                biblionumber => $biblio->{biblionumber},
71
                notforloan => 0,
72
                itemlost   => 0,
73
                withdrawn  => 0,
74
75
            }
76
        }
77
    );
78
    my $patron = $builder->build({source => 'Borrower'});
79
80
    my $checkout = AddIssue( $patron, $item->{barcode} );
81
    $builder->build({ source => 'OldIssue', value => { issue_id => $checkout->issue_id } });
82
83
    my @a = AddReturn( $item->{barcode} );
84
    my $old_checkout = Koha::Old::Checkouts->find( $checkout->issue_id );
85
    isnt( $old_checkout->itemnumber, $item->{itemnumber}, 'If an item is checked-in, it should be moved to old_issues even if the issue_id already existed in the table' );
86
};
87
88
1;

Return to bug 18242