MDL-67673 phpunit: Remove deprecated assertContains() uses on strings

Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
This commit is contained in:
Eloy Lafuente (stronk7)
2020-10-21 12:46:05 +02:00
parent 106c64ac24
commit 35bc26b516
113 changed files with 720 additions and 720 deletions
+1 -1
View File
@@ -1729,7 +1729,7 @@ class core_cache_testcase extends advanced_testcase {
cache_helper::purge_by_definition('phpunit', 'purge2');
$this->fail('Should not be able to purge a definition required identifiers without providing them.');
} catch (coding_exception $ex) {
$this->assertContains('Identifier required for cache has not been provided', $ex->getMessage());
$this->assertStringContainsString('Identifier required for cache has not been provided', $ex->getMessage());
}
}