Merge "Do not directly construct UserrightsPage in tests"

This commit is contained in:
jenkins-bot 2021-03-05 10:11:57 +00:00 committed by Gerrit Code Review
commit 29cd094a6c

View file

@ -1,7 +1,5 @@
<?php
use MediaWiki\MediaWikiServices;
/**
* Tests for the built in notification types
*
@ -40,9 +38,9 @@ class NotificationsTest extends MediaWikiTestCase {
$context = new DerivativeContext( RequestContext::getMain() );
$context->setUser( $this->sysop );
$ur = new UserrightsPage(
MediaWikiServices::getInstance()->getPermissionManager()
);
$ur = $this->getServiceContainer()
->getSpecialPageFactory()
->getPage( 'Userrights' );
$ur->setContext( $context );
$ur->doSaveUserGroups( $user, [ 'sysop' ], [], 'reason' );
$event = self::getLatestNotification( $user );