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

(-)a/t/DateUtils.t (-2 / +17 lines)
Lines 3-9 use DateTime; Link Here
3
use DateTime::TimeZone;
3
use DateTime::TimeZone;
4
4
5
use C4::Context;
5
use C4::Context;
6
use Test::More tests => 42;
6
use Test::More tests => 45;
7
use Test::MockModule;
7
use Test::MockModule;
8
use Time::HiRes qw/ gettimeofday /;
8
use Time::HiRes qw/ gettimeofday /;
9
9
Lines 162-164 cmp_ok $date_string, 'eq', '12/11/2013 06:35 PM', 'as_due_date with hours and ti Link Here
162
162
163
my $now = DateTime->now;
163
my $now = DateTime->now;
164
is( dt_from_string, $now, "Without parameter, dt_from_string should return today" );
164
is( dt_from_string, $now, "Without parameter, dt_from_string should return today" );
165
- 
165
166
# Test dt_from_string
167
168
$module_context->mock(
169
    'preference',
170
    sub {
171
        return 'metric';
172
    }
173
);
174
175
$dt = dt_from_string( '31/01/2015' );
176
is( ref($dt), 'DateTime' );
177
$dt = eval { dt_from_string( '31/01/2015', 'iso' ); };
178
is( ref($dt), '' );
179
$dt = eval { dt_from_string( '01/01/2015', 'iso' ); };
180
is( ref($dt), '' );

Return to bug 11120