diff options
Diffstat (limited to 'MLEB/Translate/tests/phpunit/api/ApiTranslationReviewTest.php')
-rw-r--r-- | MLEB/Translate/tests/phpunit/api/ApiTranslationReviewTest.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/MLEB/Translate/tests/phpunit/api/ApiTranslationReviewTest.php b/MLEB/Translate/tests/phpunit/api/ApiTranslationReviewTest.php index 8266c0d4..930dad0e 100644 --- a/MLEB/Translate/tests/phpunit/api/ApiTranslationReviewTest.php +++ b/MLEB/Translate/tests/phpunit/api/ApiTranslationReviewTest.php @@ -16,12 +16,16 @@ class ApiTranslationReviewTest extends MediaWikiTestCase { global $wgHooks; $this->setMwGlobals( [ 'wgHooks' => $wgHooks, - 'wgGroupPermissions' => [], + 'wgGroupPermissions' => [ + 'sysop' => [ + 'translate-messagereview' => true, + ], + ], 'wgTranslateMessageNamespaces' => [ NS_MEDIAWIKI ], ] ); $wgHooks['TranslatePostInitGroups'] = [ [ $this, 'getTestGroups' ] ]; $mg = MessageGroups::singleton(); - $mg->setCache( wfGetCache( 'hash' ) ); + $mg->setCache( new WANObjectCache( [ 'cache' => wfGetCache( 'hash' ) ] ) ); $mg->recache(); MessageIndex::setInstance( new HashMessageIndex() ); @@ -40,13 +44,11 @@ class ApiTranslationReviewTest extends MediaWikiTestCase { } public function testgetReviewBlockers() { - $superUser1 = new MockSuperUser(); - $superUser1->setId( 1 ); + $superUser1 = $this->getMutableTestUser( [ 'sysop', 'bureaucrat' ] )->getUser(); - $superUser2 = new MockSuperUser(); - $superUser2->setId( 2 ); + $superUser2 = $this->getMutableTestUser( [ 'sysop', 'bureaucrat' ] )->getUser(); - $plainUser = User::newFromName( 'PlainUser' ); + $plainUser = $this->getMutableTestUser()->getUser(); $title = Title::makeTitle( NS_MEDIAWIKI, 'Ugakey1/fi' ); $content = ContentHandler::makeContent( 'trans1', $title ); |