MDL-83468 phpunit: Fix various tests after phpunit 10
This commit is contained in:
@@ -153,7 +153,7 @@ class core_date {
|
||||
|
||||
// Is server timezone usable?
|
||||
if (isset($CFG->timezone) and !is_numeric($CFG->timezone)) {
|
||||
$result = @timezone_open($CFG->timezone); // Hide notices if invalid.
|
||||
$result = timezone_open($CFG->timezone); // Hide notices if invalid.
|
||||
if ($result !== false) {
|
||||
return $result->getName();
|
||||
}
|
||||
@@ -319,7 +319,7 @@ class core_date {
|
||||
if (!defined('PHPUNIT_TEST')) {
|
||||
throw new coding_exception('core_date::phpunit_override_default_php_timezone() must be used only from unit tests');
|
||||
}
|
||||
$result = timezone_open($tz ?? ''); // This triggers error if $tz invalid.
|
||||
$result = @timezone_open($tz ?? ''); // This triggers error if $tz invalid.
|
||||
if ($result !== false) {
|
||||
self::$defaultphptimezone = $tz;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user