diff --git a/tests/phpunit/AbuseFilterSaveTest.php b/tests/phpunit/AbuseFilterSaveTest.php index 5c923990d..01d3c311e 100644 --- a/tests/phpunit/AbuseFilterSaveTest.php +++ b/tests/phpunit/AbuseFilterSaveTest.php @@ -90,6 +90,7 @@ class AbuseFilterSaveTest extends MediaWikiTestCase { 'abusefilter-modify-global' => true, ] ] ); + $this->overrideMwServices(); } /** diff --git a/tests/phpunit/AbuseFilterTest.php b/tests/phpunit/AbuseFilterTest.php index 9643d7c78..e3f3647a0 100644 --- a/tests/phpunit/AbuseFilterTest.php +++ b/tests/phpunit/AbuseFilterTest.php @@ -91,6 +91,7 @@ class AbuseFilterTest extends MediaWikiTestCase { ], 'wgEnableParserLimitReporting' => false ] ); + $this->overrideMwServices(); } /** @@ -153,8 +154,10 @@ class AbuseFilterTest extends MediaWikiTestCase { $this->setGroupPermissions( [ 'AFTestUserRights' => array_fill_keys( $rights, true ) ] ); + $this->overrideMwServices(); $previous = $user->getRights(); $user->addGroup( 'AFTestUserRights' ); + $user->clearInstanceCache(); $result = array_merge( $rights, $previous ); break; case 'user_blocked':