diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index 7aa43a8d5f2..991c4ceef8d 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -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 = << 'no', 'component' => 'moodle', 'a' => NULL,