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
+3 -3
View File
@@ -425,9 +425,9 @@ class core_tablelib_testcase extends advanced_testcase {
$table->define_baseurl('/invalid.php');
$row = $table->get_row_html($data);
$this->assertRegExp('/row 0 col 0/', $row);
$this->assertRegExp('/<tr class=""/', $row);
$this->assertRegExp('/<td class="cell c0"/', $row);
$this->assertMatchesRegularExpression('/row 0 col 0/', $row);
$this->assertMatchesRegularExpression('/<tr class=""/', $row);
$this->assertMatchesRegularExpression('/<td class="cell c0"/', $row);
}
public function test_persistent_table() {