Fix remainder of unit test warnings in PHP 8.0

This commit is contained in:
Kijin Sung 2021-01-29 00:36:24 +09:00
parent e368cb2f2a
commit 334b1cc277
8 changed files with 30 additions and 19 deletions

View file

@ -9,6 +9,7 @@ class DateTimeTest extends \Codeception\TestCase\Test
// Add some dummy data to system configuration. Asia/Seoul offset is 32400.
Rhymix\Framework\Config::set('locale.default_timezone', 'Asia/Seoul');
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
Context::set('_default_timezone', $GLOBALS['_time_zone'] = 'Asia/Seoul');
// Set PHP time zone to the internal time zone.
$this->old_timezone = @date_default_timezone_get();
@ -17,6 +18,11 @@ class DateTimeTest extends \Codeception\TestCase\Test
public function _after()
{
// Restore the default and internal timezone.
Rhymix\Framework\Config::set('locale.default_timezone', 'Asia/Seoul');
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
Context::set('_default_timezone', $GLOBALS['_time_zone'] = 'Asia/Seoul');
// Restore the old timezone.
date_default_timezone_set($this->old_timezone);
}