MDL-38840 Statslib - Fix failing unit tests on ci server (DST change)

This commit is contained in:
Damyon Wiese
2013-04-02 16:49:21 +02:00
committed by Eloy Lafuente (stronk7)
parent b2c04be9c5
commit 70a9bf863b
+3 -2
View File
@@ -327,7 +327,8 @@ class statslib_daily_testcase extends advanced_testcase {
$CFG->statsfirstrun = 'all';
// Allow 1 second difference in case we cross a second boundary.
$this->assertLessThanOrEqual(1, stats_get_start_from('daily') - ($time - (3 * 24 * 3600)), 'All start time');
// Note: within 3 days of a DST change - -3 days != 3 * 24 hours (it may be more or less).
$this->assertLessThanOrEqual(1, stats_get_start_from('daily') - strtotime('-3 days', $time), 'All start time');
$this->prepare_db($dataset[0], array('log'));
$records = $DB->get_records('log');
@@ -335,7 +336,7 @@ class statslib_daily_testcase extends advanced_testcase {
$this->assertEquals($day + 14410, stats_get_start_from('daily'), 'Log entry start');
$CFG->statsfirstrun = 'none';
$this->assertLessThanOrEqual(1, stats_get_start_from('daily') - ($time - (3 * 24 * 3600)), 'None start time');
$this->assertLessThanOrEqual(1, stats_get_start_from('daily') - strtotime('-3 days', $time), 'None start time');
$CFG->statsfirstrun = 14515200;
$this->assertLessThanOrEqual(1, stats_get_start_from('daily') - ($time - (14515200)), 'Specified start time');