diff --git a/tests/phpunit/AbuseFilterConsequencesTest.php b/tests/phpunit/AbuseFilterConsequencesTest.php index 79cb7b5b6..6e488b6ba 100644 --- a/tests/phpunit/AbuseFilterConsequencesTest.php +++ b/tests/phpunit/AbuseFilterConsequencesTest.php @@ -687,7 +687,8 @@ class AbuseFilterConsequencesTest extends MediaWikiTestCase { case 'degroup': // Aborts the hook with 'abusefilter-degrouped' error and degroups the user. $expectedErrors['degroup'][] = 'abusefilter-degrouped'; - $groupCheck = !in_array( 'sysop', $this->user->getEffectiveGroups() ); + $ugm = MediaWikiServices::getInstance()->getUserGroupManager(); + $groupCheck = !in_array( 'sysop', $ugm->getUserEffectiveGroups( $this->user ) ); if ( !$groupCheck ) { $testErrorMessage = 'The user was not degrouped.'; }