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

(-)a/t/db_dependent/Circulation.t (-2 / +37 lines)
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 => 60;
21
use Test::More tests => 61;
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 2146-2151 subtest 'AddIssue | recalls' => sub { Link Here
2146
    AddReturn( $item->barcode, $item->homebranch );
2146
    AddReturn( $item->barcode, $item->homebranch );
2147
};
2147
};
2148
2148
2149
subtest 'AddIssue & illrequests.date_due' => sub {
2150
    plan tests => 2;
2151
2152
    t::lib::Mocks::mock_preference( 'ILLModule', 1 );
2153
    my $library = $builder->build( { source => 'Branch' } );
2154
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
2155
    my $item = $builder->build_sample_item();
2156
2157
    set_userenv($library);
2158
2159
    my $custom_date_due = '9999-12-18 12:34:56';
2160
    my $expected_date_due = '9999-12-18 23:59:00';
2161
    my $illrequest = Koha::Illrequest->new({
2162
        borrowernumber => $patron->borrowernumber,
2163
        biblio_id => $item->biblionumber,
2164
        branchcode => $library->{'branchcode'},
2165
        date_due => $custom_date_due,
2166
    })->store;
2167
2168
    my $issue = AddIssue( $patron->unblessed, $item->barcode );
2169
    is( $issue->date_due, $expected_date_due, 'Custom illrequest date due has been set for this issue');
2170
2171
    $patron = $builder->build_object( { class => 'Koha::Patrons' } );
2172
    $item = $builder->build_sample_item();
2173
    $custom_date_due = '9999-12-19';
2174
    $expected_date_due = '9999-12-19 23:59:00';
2175
    $illrequest = Koha::Illrequest->new({
2176
        borrowernumber => $patron->borrowernumber,
2177
        biblio_id => $item->biblionumber,
2178
        branchcode => $library->{'branchcode'},
2179
        date_due => $custom_date_due,
2180
    })->store;
2181
2182
    $issue = AddIssue( $patron->unblessed, $item->barcode );
2183
    is( $issue->date_due, $expected_date_due, 'Custom illrequest date due has been set for this issue');
2184
};
2149
2185
2150
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
2186
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
2151
    plan tests => 8;
2187
    plan tests => 8;
2152
- 

Return to bug 24239