mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
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:
parent
106c64ac24
commit
35bc26b516
113 changed files with 720 additions and 720 deletions
|
@ -66,7 +66,7 @@ class core_notes_generator_testcase extends advanced_testcase {
|
|||
$gen->create_instance(array('courseid' => 2));
|
||||
$this->fail('A note should not be allowed to be created without associcated userid');
|
||||
} catch (coding_exception $e) {
|
||||
$this->assertContains('Module generator requires $record->userid', $e->getMessage());
|
||||
$this->assertStringContainsString('Module generator requires $record->userid', $e->getMessage());
|
||||
}
|
||||
|
||||
// Test not setting courseid.
|
||||
|
@ -74,7 +74,7 @@ class core_notes_generator_testcase extends advanced_testcase {
|
|||
$gen->create_instance(array('userid' => 2));
|
||||
$this->fail('A note should not be allowed to be created without associcated courseid');
|
||||
} catch (coding_exception $e) {
|
||||
$this->assertContains('Module generator requires $record->courseid', $e->getMessage());
|
||||
$this->assertStringContainsString('Module generator requires $record->courseid', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue