Lines 4-17
use DateTime::TimeZone;
Link Here
|
4 |
|
4 |
|
5 |
use C4::Context; |
5 |
use C4::Context; |
6 |
|
6 |
|
7 |
use Test::More tests => 82; |
7 |
use Test::More tests => 83; |
8 |
|
8 |
|
9 |
use Test::MockModule; |
9 |
use Test::MockModule; |
10 |
use Test::Warn; |
10 |
use Test::Warn; |
11 |
use Time::HiRes qw/ gettimeofday /; |
11 |
use Time::HiRes qw/ gettimeofday /; |
12 |
use Try::Tiny; |
12 |
use Try::Tiny; |
13 |
|
13 |
|
14 |
use Koha::DateUtils qw( dt_from_string output_pref format_sqldatetime ); |
14 |
use Koha::DateUtils qw( dt_from_string output_pref format_sqldatetime flatpickr_date_format ); |
15 |
|
15 |
|
16 |
use t::lib::Mocks; |
16 |
use t::lib::Mocks; |
17 |
|
17 |
|
Lines 389-392
try {
Link Here
|
389 |
is( ref($_), 'Koha::Exceptions::WrongParameter', 'output_pref should throw an exception if str and dt parameters are passed together' ); |
389 |
is( ref($_), 'Koha::Exceptions::WrongParameter', 'output_pref should throw an exception if str and dt parameters are passed together' ); |
390 |
}; |
390 |
}; |
391 |
|
391 |
|
|
|
392 |
subtest 'flatpickr_date_format' => sub { |
393 |
plan tests => 4; |
394 |
|
395 |
t::lib::Mocks::mock_preference('dateformat', 'iso'); |
396 |
is( flatpickr_date_format(), 'Y-m-d', 'check fallback to pref' ); |
397 |
is( flatpickr_date_format(q{}), undef, 'empty string' ); |
398 |
is( flatpickr_date_format('metric'), 'd/m/Y', 'check valid arg' ); |
399 |
is( flatpickr_date_format('zz'), undef, 'wrong arg' ); |
400 |
}; |
401 |
|
392 |
# End of tests |
402 |
# End of tests |
393 |
- |
|
|