MDL-71036 phpunit: Renamed various file-related assertions

In PHPUnit 9.1, the following file-related assertions
have been deprecated and there are new alternatives for
all them:
- assertNotIsReadable()         -> assertIsNotReadable()
- assertNotIsWritable()         -> assertIsNotWritable()
- assertDirectoryNotExists()    -> assertDirectoryDoesNotExist()
- assertDirectoryNotIsReadable()-> assertDirectoryIsNotReadable()
- assertDirectoryNotIsWritable()-> assertDirectoryIsNotWritable()
- assertFileNotExists()         -> assertFileDoesNotExist()
- assertFileNotIsReadable()     -> assertFileIsNotReadable()
- assertFileNotIsWritable()     -> assertFileIsNotWritable()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

ag 'assertNotIsReadable|assertNotIsWritable|assertDirectoryNotExists|\
assertDirectoryNotIsReadable|assertDirectoryNotIsWritable|\
assertFileNotExists|assertFileNotIsReadable|assertFileNotIsWritable'
This commit is contained in:
Eloy Lafuente (stronk7)
2021-03-11 19:22:23 +01:00
parent 5fcd5e1cf7
commit 309a65a6f7
9 changed files with 26 additions and 26 deletions
+2 -2
View File
@@ -251,8 +251,8 @@ class core_plugin_manager_testcase extends advanced_testcase {
$this->assertFileExists("$CFG->dirroot/mod/assign", 'assign module is not present');
$this->assertFileExists("$CFG->dirroot/mod/forum", 'forum module is not present');
$this->assertFileExists("$CFG->dirroot/$CFG->admin/tool/phpunit", 'phpunit tool is not present');
$this->assertFileNotExists("$CFG->dirroot/mod/xxxxxxx");
$this->assertFileNotExists("$CFG->dirroot/enrol/autorize");
$this->assertFileDoesNotExist("$CFG->dirroot/mod/xxxxxxx");
$this->assertFileDoesNotExist("$CFG->dirroot/enrol/autorize");
// Ready for upgrade.
$assignversion = get_config('mod_assign', 'version');