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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user