mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 03:16:42 +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
|
@ -974,13 +974,13 @@ abstract class qbehaviour_walkthrough_test_base extends question_testcase {
|
|||
|
||||
protected function check_output_contains($string) {
|
||||
$this->render();
|
||||
$this->assertContains($string, $this->currentoutput,
|
||||
$this->assertStringContainsString($string, $this->currentoutput,
|
||||
'Expected string ' . $string . ' not found in ' . $this->currentoutput);
|
||||
}
|
||||
|
||||
protected function check_output_does_not_contain($string) {
|
||||
$this->render();
|
||||
$this->assertNotContains($string, $this->currentoutput,
|
||||
$this->assertStringNotContainsString($string, $this->currentoutput,
|
||||
'String ' . $string . ' unexpectedly found in ' . $this->currentoutput);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue