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:
Eloy Lafuente (stronk7)
2021-03-11 23:07:30 +01:00
parent cbf01aa79a
commit c989d6ec61
81 changed files with 620 additions and 620 deletions
@@ -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);
}