summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/tests/phpunit/api/ApiQueryMessageGroupsTest.php')
-rw-r--r--MLEB/Translate/tests/phpunit/api/ApiQueryMessageGroupsTest.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/MLEB/Translate/tests/phpunit/api/ApiQueryMessageGroupsTest.php b/MLEB/Translate/tests/phpunit/api/ApiQueryMessageGroupsTest.php
index 4ce7eebe..bc797a83 100644
--- a/MLEB/Translate/tests/phpunit/api/ApiQueryMessageGroupsTest.php
+++ b/MLEB/Translate/tests/phpunit/api/ApiQueryMessageGroupsTest.php
@@ -1,7 +1,5 @@
<?php
/**
- * Unit tests for api module.
- *
* @file
* @author Harry Burt
* @copyright Copyright © 2012-2013, Harry Burt
@@ -13,15 +11,14 @@
*/
class ApiQueryMessageGroupsTest extends ApiTestCase {
- protected function setUp() {
+ protected function setUp() : void {
parent::setUp();
- global $wgHooks;
$this->setMwGlobals( [
- 'wgHooks' => $wgHooks,
'wgTranslateTranslationServices' => [],
] );
- $wgHooks['TranslatePostInitGroups'] = [ [ $this, 'getTestGroups' ] ];
+ $this->setTemporaryHook( 'TranslateInitGroupLoaders', [] );
+ $this->setTemporaryHook( 'TranslatePostInitGroups', [ $this, 'getTestGroups' ] );
$mg = MessageGroups::singleton();
$mg->setCache( new WANObjectCache( [ 'cache' => wfGetCache( 'hash' ) ] ) );
@@ -81,8 +78,8 @@ class ApiQueryMessageGroupsTest extends ApiTestCase {
$this->assertSame( $items[1]['exists'], true );
$this->assertSame( $items[0]['namespace'], 5 );
$this->assertSame( $items[1]['namespace'], 5 );
- $this->assertSame( $items[0]['class'], 'WikiMessageGroup' );
- $this->assertSame( $items[1]['class'], 'WikiMessageGroup' );
+ $this->assertSame( $items[0]['class'], WikiMessageGroup::class );
+ $this->assertSame( $items[1]['class'], WikiMessageGroup::class );
}
public function testAPIFilterAccuracy() {
@@ -127,7 +124,7 @@ class ApiQueryMessageGroupsTest extends ApiTestCase {
$this->assertSame( $item['exists'], true );
$this->assertStringEndsWith( 'id', $item['id'] ); // theid, anotherid
$this->assertSame( $item['namespace'], 5 );
- $this->assertSame( $item['class'], 'WikiMessageGroup' );
+ $this->assertSame( $item['class'], WikiMessageGroup::class );
}
}