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

(-)a/t/DateUtils.t (-2 / +9 lines)
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 => 72;
7
use Test::More tests => 74;
8
8
9
use Test::MockModule;
9
use Test::MockModule;
10
use Test::Warn;
10
use Test::Warn;
Lines 137-142 cmp_ok( $dt0->epoch(), 'eq', '1325462399', 'dt_from_string handles seconds with Link Here
137
$dt0 = dt_from_string( '2012-01-01T23:59:59.999+02:00', 'rfc3339' );
137
$dt0 = dt_from_string( '2012-01-01T23:59:59.999+02:00', 'rfc3339' );
138
cmp_ok( $dt0->epoch(), 'eq', '1325455199', 'dt_from_string handles seconds with 3 decimal places and a timezone' );
138
cmp_ok( $dt0->epoch(), 'eq', '1325455199', 'dt_from_string handles seconds with 3 decimal places and a timezone' );
139
139
140
try {
141
    $dt0 = dt_from_string( '2012-01-01T23:59:59.999Z+02:00', 'rfc3339' );
142
    ok( 0, 'Invalid date string passed to dt_from_string' );
143
}
144
catch {
145
    is( $_, 'does not match', 'dt_from_string should die when passed a bad date string' );
146
};
147
140
# Return undef if passed mysql 0 dates
148
# Return undef if passed mysql 0 dates
141
$dt0 = dt_from_string( '0000-00-00', 'iso' );
149
$dt0 = dt_from_string( '0000-00-00', 'iso' );
142
is( $dt0, undef, "undefined returned for 0 iso date" );
150
is( $dt0, undef, "undefined returned for 0 iso date" );
143
- 

Return to bug 24850