mirror of
https://github.com/moodle/moodle.git
synced 2025-07-10 00:46:32 +02:00
After some tests, it seems that we can safely cover phpunit_util::reset_all_data() executing it within own basic_test self tests. That way we can confirm that the reset code is doing its job and detecting unexpected changes at various levels (database, globals, ...). Note that, in order to catch the E_USER_WARNINGS, for PHPUnit 9.6 and up, we have to convert them to exceptions, because the notice/ warning/error expectations have been deprecated and will be removed in PHPUnit 10. So we are using a trick, already used also by advanced_test. And, no matter that we are repeating the trick a few times, that's ok in order to have all its uses controlled.