When running PHPUnit tests using moodle-plugin-ci, errors can appear as notices:
RUN PHPUnit tests for ...
Moodle 5.2dev (Build: 20251205)
Php: 8.3.6, pgsql: 16.11 (Ubuntu 16.11-0ubuntu0.24.04.1), OS: Linux 6.8.0-88-generic x86_64
PHPUnit 11.5.43 by Sebastian Bergmann and contributors.
Runtime: PHP 8.3.6 with PCOV 1.0.11
.......NN.......... 18 / 18 (100%)
OK, but there were issues!
Tests: 18, Assertions: 268, Notices: 2.
When running phpunit tests using vendor/bin/phpunit --display-deprecations --display-notices --testsuite=..._testsuite the output is showing debugging and deprecation messages:
1 test triggered 2 notices:
1) lib/phpunit/classes/advanced_testcase.php:88
Unexpected debugging() call detected.
Debugging: Deprecation: set_section_visible has been deprecated since 5.2. Course activity editing global functions have been moved to format actions. Use core_courseformat\local\sectionactions::set_visibility instead. See MDL-86861 for more information.
2) lib/phpunit/classes/advanced_testcase.php:88
Unexpected debugging() call detected.
Debugging: cURL request for "https://..." failed with: Failed to connect to ... after 3055 ms: Couldn't connect to server (7)
The same behaviour is seen in ci.moodle.org (sample) where 20 notices pass without being noticed.
Why not enable display-deprecations and display-notices by default?
When running PHPUnit tests using moodle-plugin-ci, errors can appear as notices:
When running phpunit tests using
vendor/bin/phpunit --display-deprecations --display-notices --testsuite=..._testsuitethe output is showing debugging and deprecation messages:The same behaviour is seen in ci.moodle.org (sample) where 20 notices pass without being noticed.
Why not enable display-deprecations and display-notices by default?