aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/changes/EnhancedChangesListTest.php
diff options
context:
space:
mode:
authorDaimona Eaytoy <daimona.wiki@gmail.com>2022-10-07 19:03:35 +0200
committerJames D. Forrester <jforrester@wikimedia.org>2022-10-07 14:13:16 -0400
commitee672592d8b18d2c76f225c875509307380b7925 (patch)
tree2c7c491680f0bf46889244c2961d2b7281496331 /tests/phpunit/includes/changes/EnhancedChangesListTest.php
parentbb2fc938e529c75a6a8226b473f5a1cf23dbb56c (diff)
downloadmediawikicore-ee672592d8b18d2c76f225c875509307380b7925.tar.gz
mediawikicore-ee672592d8b18d2c76f225c875509307380b7925.zip
tests: Replace assertRegExp with assertMatchesRegularExpression
And also assertNotRegExp -> assertDoesNotMatchRegularExpression. The methods were renamed in PHPUnit 9. Done automatically with: grep -rl assertRegExp tests/ | xargs sed -r -i "s/>assertRegExp\(/>assertMatchesRegularExpression\(/" grep -rl assertNotRegExp tests/ | xargs sed -r -i "s/>assertNotRegExp\(/>assertDoesNotMatchRegularExpression\(/" Split out from Ifdba0f9e98eb6bce4590b7eb73170c51a697d7c6 so that it remains smaller and easier to review. Also make a test use MediaWikiUnitTestCase (it's already in the unit/ dir) so that it can access the forward-compat method. Bug: T243600 Change-Id: Ifa279d5f201d7abeebece292141ebface8278046
Diffstat (limited to 'tests/phpunit/includes/changes/EnhancedChangesListTest.php')
-rw-r--r--tests/phpunit/includes/changes/EnhancedChangesListTest.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/phpunit/includes/changes/EnhancedChangesListTest.php b/tests/phpunit/includes/changes/EnhancedChangesListTest.php
index f2256ca8f351..3a1813f4fb9b 100644
--- a/tests/phpunit/includes/changes/EnhancedChangesListTest.php
+++ b/tests/phpunit/includes/changes/EnhancedChangesListTest.php
@@ -116,10 +116,10 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase {
$html = $enhancedChangesList->endRecentChangesList();
- $this->assertRegExp( '/Hello world prefix/', $html );
+ $this->assertMatchesRegularExpression( '/Hello world prefix/', $html );
// Test EnhancedChangesListModifyLineData hook was run
- $this->assertRegExp( '/This is a minor edit/', $html );
+ $this->assertMatchesRegularExpression( '/This is a minor edit/', $html );
// Two separate lines
$enhancedChangesList->beginRecentChangesList();
@@ -132,7 +132,7 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase {
$html = $enhancedChangesList->endRecentChangesList();
// Test EnhancedChangesListModifyBlockLineData hook was run
- $this->assertRegExp( '/This edit was performed by a bot/', $html );
+ $this->assertMatchesRegularExpression( '/This edit was performed by a bot/', $html );
preg_match_all( '/Hello world prefix/', $html, $matches );
$this->assertCount( 2, $matches[0] );
@@ -163,7 +163,7 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase {
$enhancedChangesList->recentChangesLine( $recentChange, false );
$html = $enhancedChangesList->endRecentChangesList();
- $this->assertRegExp(
+ $this->assertMatchesRegularExpression(
'/data-mw-revid="5" data-mw-ts="20131103092153" class="[^"]*mw-enhanced-rc[^"]*"/',
$html
);