Lines 4-10
use DateTime::TimeZone;
Link Here
|
4 |
|
4 |
|
5 |
use C4::Context; |
5 |
use C4::Context; |
6 |
|
6 |
|
7 |
use Test::More tests => 60; |
7 |
use Test::More tests => 63; |
8 |
|
8 |
|
9 |
use Test::MockModule; |
9 |
use Test::MockModule; |
10 |
use Test::Warn; |
10 |
use Test::Warn; |
Lines 219-224
is( output_pref( { dt => $dt, dateonly => 1 } ), '01/01/1900', 'dt_from_string s
Link Here
|
219 |
$dt = dt_from_string('2015-01-31 01:02:03'); |
219 |
$dt = dt_from_string('2015-01-31 01:02:03'); |
220 |
is( output_pref( {dt => $dt} ), '31/01/2015 01:02', 'dt_from_string should fallback to sql format' ); |
220 |
is( output_pref( {dt => $dt} ), '31/01/2015 01:02', 'dt_from_string should fallback to sql format' ); |
221 |
|
221 |
|
|
|
222 |
# output_pref with no parameters, single parameter (no hash) |
223 |
is( output_pref(), undef, 'output_pref without parameters' ); |
224 |
is( output_pref( 'no_dt' ), undef, 'Passed single invalid dt to output_pref' ); |
225 |
|
226 |
# pass invalid dt via hash |
227 |
is( output_pref({ dt => 'no_dt' }), undef, 'Passed invalid dt in hash to output_pref' ); |
228 |
|
222 |
# output_pref with str parameter |
229 |
# output_pref with str parameter |
223 |
is( output_pref( { 'str' => $testdate_iso, dateformat => 'iso', dateonly => 1 } ), $testdate_iso, 'output_pref should handle correctly the iso parameter' ); |
230 |
is( output_pref( { 'str' => $testdate_iso, dateformat => 'iso', dateonly => 1 } ), $testdate_iso, 'output_pref should handle correctly the iso parameter' ); |
224 |
my $output_for_invalid_date; |
231 |
my $output_for_invalid_date; |
225 |
- |
|
|