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