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 222-227
is( output_pref( { dt => $dt, dateonly => 1 } ), '01/01/1900', 'dt_from_string s
Link Here
|
222 |
$dt = dt_from_string('2015-01-31 01:02:03'); |
222 |
$dt = dt_from_string('2015-01-31 01:02:03'); |
223 |
is( output_pref( {dt => $dt} ), '31/01/2015 01:02', 'dt_from_string should fallback to sql format' ); |
223 |
is( output_pref( {dt => $dt} ), '31/01/2015 01:02', 'dt_from_string should fallback to sql format' ); |
224 |
|
224 |
|
|
|
225 |
# output_pref with no parameters, single parameter (no hash) |
226 |
is( output_pref(), undef, 'output_pref without parameters' ); |
227 |
is( output_pref( 'no_dt' ), undef, 'Passed single invalid dt to output_pref' ); |
228 |
|
229 |
# pass invalid dt via hash |
230 |
is( output_pref({ dt => 'no_dt' }), undef, 'Passed invalid dt in hash to output_pref' ); |
231 |
|
225 |
# output_pref with str parameter |
232 |
# output_pref with str parameter |
226 |
is( output_pref( { 'str' => $testdate_iso, dateformat => 'iso', dateonly => 1 } ), $testdate_iso, 'output_pref should handle correctly the iso parameter' ); |
233 |
is( output_pref( { 'str' => $testdate_iso, dateformat => 'iso', dateonly => 1 } ), $testdate_iso, 'output_pref should handle correctly the iso parameter' ); |
227 |
my $output_for_invalid_date; |
234 |
my $output_for_invalid_date; |
228 |
- |
|
|