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

(-)a/t/db_dependent/SIP/Transaction.t (-5 / +19 lines)
Lines 7-12 use Modern::Perl; Link Here
7
use Test::More tests => 19;
7
use Test::More tests => 19;
8
use Test::Warn;
8
use Test::Warn;
9
9
10
use DateTime;
11
10
use Koha::Database;
12
use Koha::Database;
11
use t::lib::TestBuilder;
13
use t::lib::TestBuilder;
12
use t::lib::Mocks;
14
use t::lib::Mocks;
Lines 771-777 subtest do_checkout_with_sysprefs_override => sub { Link Here
771
};
773
};
772
774
773
subtest do_checkout_with_patron_blocked => sub {
775
subtest do_checkout_with_patron_blocked => sub {
774
    plan tests => 5;
776
777
    plan tests => 8;
775
778
776
    my $mockILS     = Test::MockObject->new;
779
    my $mockILS     = Test::MockObject->new;
777
    my $server      = { ils => $mockILS };
780
    my $server      = { ils => $mockILS };
Lines 804-820 subtest do_checkout_with_patron_blocked => sub { Link Here
804
        }
807
        }
805
    );
808
    );
806
809
810
    my $date_expiry = DateTime->new( year => 2020, month => 1, day => 3 );
811
807
    my $expired_patron = $builder->build_object(
812
    my $expired_patron = $builder->build_object(
808
        {
813
        {
809
            class => 'Koha::Patrons',
814
            class => 'Koha::Patrons',
810
            value => {
815
            value => {
811
                branchcode => $library->branchcode,
816
                branchcode => $library->branchcode,
812
                dateexpiry => '2020/01/03',
817
                dateexpiry => $date_expiry,
813
            }
818
            }
814
        }
819
        }
815
    );
820
    );
816
    my $circ = $ils->checkout( $expired_patron->cardnumber, $item->barcode );
821
817
    is( $circ->{screen_msg}, 'Patron expired on 01/03/2020', "Got correct expired screen message" );
822
    my $circ;
823
824
    foreach my $dateformat (qw{metric us iso dmydot}) {
825
        t::lib::Mocks::mock_preference( 'dateformat', $dateformat );
826
        $circ = $ils->checkout( $expired_patron->cardnumber, $item->barcode );
827
        is(
828
            $circ->{screen_msg},
829
            'Patron expired on ' . output_pref( { dt => dt_from_string( $date_expiry, 'iso' ), dateonly => 1 } ),
830
            "Got correct expired screen message"
831
        );
832
    }
818
833
819
    my $fines_patron = $builder->build_object(
834
    my $fines_patron = $builder->build_object(
820
        {
835
        {
821
- 

Return to bug 38418