summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/tests/phpunit/MessageCollectionTest.php')
-rw-r--r--MLEB/Translate/tests/phpunit/MessageCollectionTest.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/MLEB/Translate/tests/phpunit/MessageCollectionTest.php b/MLEB/Translate/tests/phpunit/MessageCollectionTest.php
index e73eb4ff..4d819377 100644
--- a/MLEB/Translate/tests/phpunit/MessageCollectionTest.php
+++ b/MLEB/Translate/tests/phpunit/MessageCollectionTest.php
@@ -23,7 +23,7 @@ class MessageCollectionTest extends MediaWikiTestCase {
$wgHooks['TranslatePostInitGroups'] = [ [ $this, 'getTestGroups' ] ];
$mg = MessageGroups::singleton();
- $mg->setCache( wfGetCache( 'hash' ) );
+ $mg->setCache( new WANObjectCache( [ 'cache' => wfGetCache( 'hash' ) ] ) );
$mg->recache();
MessageIndex::setInstance( new HashMessageIndex() );
@@ -41,8 +41,7 @@ class MessageCollectionTest extends MediaWikiTestCase {
}
public function testMessage() {
- $user = new MockSuperUser();
- $user->setId( 123 );
+ $user = $this->getTestSysop()->getUser();
$title = Title::newFromText( 'MediaWiki:translated/fi' );
$page = WikiPage::factory( $title );
$content = ContentHandler::makeContent( 'pupuliini', $title );
@@ -63,8 +62,8 @@ class MessageCollectionTest extends MediaWikiTestCase {
$this->assertEquals( 'translated', $translated->key() );
$this->assertEquals( 'bunny', $translated->definition() );
$this->assertEquals( 'pupuliini', $translated->translation() );
- $this->assertEquals( 'SuperUser', $translated->getProperty( 'last-translator-text' ) );
- $this->assertEquals( 123, $translated->getProperty( 'last-translator-id' ) );
+ $this->assertEquals( $user->getName(), $translated->getProperty( 'last-translator-text' ) );
+ $this->assertEquals( $user->getId(), $translated->getProperty( 'last-translator-id' ) );
$this->assertEquals(
'translated',
$translated->getProperty( 'status' ),