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

(-)a/t/db_dependent/Koha/Acquisition/Order.t (-2 / +41 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 1;
22
use Test::More tests => 2;
23
23
24
use t::lib::TestBuilder;
24
use t::lib::TestBuilder;
25
use t::lib::Mocks;
25
use t::lib::Mocks;
Lines 55-57 subtest 'basket() tests' => sub { Link Here
55
55
56
    $schema->storage->txn_rollback;
56
    $schema->storage->txn_rollback;
57
};
57
};
58
- 
58
59
subtest 'store' => sub {
60
    plan tests => 1;
61
62
    $schema->storage->txn_begin;
63
    my $o = $builder->build_object(
64
        {
65
            class => 'Koha::Acquisition::Orders'
66
        }
67
    );
68
69
    subtest 'entrydate' => sub {
70
        plan tests => 2;
71
72
        my $order;
73
74
        t::lib::Mocks::mock_preference( 'TimeFormat', '12hr' );
75
        $order = Koha::Acquisition::Order->new(
76
            {
77
                basketno     => $o->basketno,
78
                biblionumber => $o->biblionumber,
79
                budget_id    => $o->budget_id,
80
            }
81
        )->store;
82
        $order->discard_changes;
83
        like( $order->entrydate, qr|^\d{4}-\d{2}-\d{2}$| );
84
85
        t::lib::Mocks::mock_preference( 'TimeFormat', '24hr' );
86
        $order = Koha::Acquisition::Order->new(
87
            {
88
                basketno     => $o->basketno,
89
                biblionumber => $o->biblionumber,
90
                budget_id    => $o->budget_id,
91
            }
92
        )->store;
93
        $order->discard_changes;
94
        like( $order->entrydate, qr|^\d{4}-\d{2}-\d{2}$| );
95
    };
96
    $schema->storage->txn_rollback;
97
};

Return to bug 20199