diff options
Diffstat (limited to 'tests/phpunit/includes/api/query/ApiQueryTest.php')
-rw-r--r-- | tests/phpunit/includes/api/query/ApiQueryTest.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php b/tests/phpunit/includes/api/query/ApiQueryTest.php index f46853bb1e7a..6378d8039a79 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryTest.php @@ -1,6 +1,6 @@ <?php -use MediaWiki\Interwiki\ClassicInterwikiLookup; +use MediaWiki\Tests\Unit\DummyServicesTrait; /** * @group API @@ -9,18 +9,17 @@ use MediaWiki\Interwiki\ClassicInterwikiLookup; * @covers ApiQuery */ class ApiQueryTest extends ApiTestCase { + use DummyServicesTrait; + protected function setUp() : void { parent::setUp(); // Setup apiquerytestiw: as interwiki prefix - $this->setMwGlobals( [ - 'wgInterwikiCache' => ClassicInterwikiLookup::buildCdbHash( [ - [ - 'iw_prefix' => 'apiquerytestiw', - 'iw_url' => 'wikipedia', - ], - ] ), + // DummyServicesTrait::getDummyInterwikiLookup + $interwikiLookup = $this->getDummyInterwikiLookup( [ + [ 'iw_prefix' => 'apiquerytestiw', 'iw_url' => 'wikipedia' ], ] ); + $this->setService( 'InterwikiLookup', $interwikiLookup ); } public function testTitlesGetNormalized() { |