mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
a293b3aea8
With PHPUnit 8 a good number of assertions, all them related with operations on non-public attributes have been deprecated. And will be removed with PHPUnit 9. The main point is that unit tests shouldn't be testing non-public APIs (good practice) and those assertions were an error originally. See https://github.com/sebastianbergmann/phpunit/issues/3338 for the complete list and other details. When possible (the attributes being checked are public), the change is simple, just switching to normal assertions. When the attributes are not public we need to find a workaround to be able to test the same using public APIs, or use Reflection, or remove the tests. For the records, this is the regexp used to find all the cases: ag '>(assertAttribute|attribute\(|readAttributte|getStaticAttribute| \ getObjectAttribute)' -G "test.php"