MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
- assertRegExp() -> assertMatchesRegularExpression()
- assertNotRegExp() -> assertDoesNotMatchRegularExpression()
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 'assertRegExp|assertNotRegExp' -li
This commit is contained in:
@@ -109,8 +109,8 @@ class qbehaviour_missing_test extends advanced_testcase {
|
||||
$this->assertEquals(array('-submit' => '1', 'choice0' => '1'), $step->get_all_data());
|
||||
|
||||
$output = $qa->render(new question_display_options(), '1');
|
||||
$this->assertRegExp('/' . preg_quote($qa->get_question(false)->questiontext, '/') . '/', $output);
|
||||
$this->assertRegExp('/' . preg_quote(
|
||||
$this->assertMatchesRegularExpression('/' . preg_quote($qa->get_question(false)->questiontext, '/') . '/', $output);
|
||||
$this->assertMatchesRegularExpression('/' . preg_quote(
|
||||
get_string('questionusedunknownmodel', 'qbehaviour_missing'), '/') . '/', $output);
|
||||
$this->assertTag(array('tag'=>'div', 'attributes'=>array('class'=>'warning')), $output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user