mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Merge "Do not directly construct UserrightsPage in tests"
This commit is contained in:
commit
29cd094a6c
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue