mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-48837 phpunit: Restore system default timezone
This commit is contained in:
parent
da0ef2e4cf
commit
914cad8793
@ -33,6 +33,19 @@ require_once($CFG->dirroot . '/backup/util/helper/backup_cron_helper.class.php')
|
||||
*/
|
||||
class backup_cron_helper_testcase extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* @var String keep system default timezone.
|
||||
*/
|
||||
protected $systemdefaulttimezone;
|
||||
|
||||
/**
|
||||
* Setup.
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->systemdefaulttimezone = date_default_timezone_get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test {@link backup_cron_automated_helper::calculate_next_automated_backup}.
|
||||
*/
|
||||
@ -457,4 +470,12 @@ class backup_cron_helper_testcase extends advanced_testcase {
|
||||
$this->assertEquals($expected, date('w-H:i', $next));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set timezone back to default.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
date_default_timezone_set($this->systemdefaulttimezone);
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user