mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +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
|
@ -309,7 +309,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase {
|
|||
core_cohort_external::update_cohorts(array($cohort1));
|
||||
$this->fail('Expecting invalid_parameter_exception exception, none occured');
|
||||
} catch (invalid_parameter_exception $e1) {
|
||||
$this->assertContains('Invalid external api parameter: the value is "THIS IS NOT AN ID"', $e1->debuginfo);
|
||||
$this->assertStringContainsString('Invalid external api parameter: the value is "THIS IS NOT AN ID"', $e1->debuginfo);
|
||||
}
|
||||
|
||||
$cohort1['id'] = 9.999; // Also not a valid id of a cohort.
|
||||
|
@ -317,7 +317,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase {
|
|||
core_cohort_external::update_cohorts(array($cohort1));
|
||||
$this->fail('Expecting invalid_parameter_exception exception, none occured');
|
||||
} catch (invalid_parameter_exception $e2) {
|
||||
$this->assertContains('Invalid external api parameter: the value is "9.999"', $e2->debuginfo);
|
||||
$this->assertStringContainsString('Invalid external api parameter: the value is "9.999"', $e2->debuginfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue