-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.2, 4.2
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MOODLE_401_STABLE
-
MDL-77953_401 -
This was detected while completing the Moodle 4.2 release testing matrix.
Note that this is not reproducible normally, when the site is running, neither via web or cli.
It's only reproducible when, on development or testing with PHPUnit, something that is not under Moodle's dirroot is being executed. And it's only a php81 deprecation message.
You can see the messages @ https://gist.githubusercontent.com/stronk7/519eb2088f0d86028bd4621241760061/raw/fb8d4d98ec48567f1ec15cdb85a1e753829edbc2/mac-php81-phpunit-pgsql-42beta
1) core\moodle_page_test::test_set_state_normal_path
|
This test printed output:
|
Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/stronk7/git_moodle/integration/lib/pagelib.php on line 1990
|
|
/private/tmp/composerbase/integration/402/vendor/phpunit/phpunit/phpunit:98
|
|
2) core\moodle_page_test::test_header_printed_becomes_true
|
This test printed output:
|
Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/stronk7/git_moodle/integration/lib/pagelib.php on line 1990
|
|
/private/tmp/composerbase/integration/402/vendor/phpunit/phpunit/phpunit:98
|
To reproduce:
- With PHP 8.1
- Run PHPUnit init.php script.
- Move the vendor directory somewhere else (for example to /tmp/vendor).
- Create a "vendor" soft link pointing to the real /tmp/vendor directory.
- Run PHPUnit -v --filter test_set_state_normal_path
Expected:
- The test passes without any notice/warning/deprecation.
Current:
- The test passes with a Deprecation message (ending as risky test).