MDL-77207 core: PHP 8.2 makes exported class name fully qualified.

This commit is contained in:
Meirza
2023-02-11 16:12:37 +07:00
parent 1ea152c99a
commit b77041ff28
+5 -1
View File
@@ -2326,8 +2326,12 @@ class moodlelib_test extends \advanced_testcase {
// Call var_export() on a newly generated lang_string.
$str = new lang_string('no');
// In PHP 8.2 exported class names are now fully qualified;
// previously, the leading backslash was omitted.
$leadingbackslash = (version_compare(PHP_VERSION, '8.2.0', '>=')) ? '\\' : '';
$expected1 = <<<EOF
lang_string::__set_state(array(
{$leadingbackslash}lang_string::__set_state(array(
'identifier' => 'no',
'component' => 'moodle',
'a' => NULL,