MDL-83468 phpunit: Fix various tests after phpunit 10

This commit is contained in:
Andrew Nicols
2025-01-20 16:47:55 +01:00
committed by Sara Arjona
parent b95a8c6ecc
commit bc75ef8bbc
51 changed files with 717 additions and 659 deletions
+2 -2
View File
@@ -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 {