wiki.techinc.nl/tests/phpunit/includes/language/LanguageFallbackIntegrationTest.php
Alexander Vorwerk decbaf4f38 phpunit: use ->getServiceContainer() in integration tests
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
2022-01-27 22:04:16 +01:00

30 lines
804 B
PHP

<?php
use MediaWiki\Languages\LanguageFallback;
/**
* @coversDefaultClass MediaWiki\Languages\LanguageFallback
* @covers ::__construct
*/
class LanguageFallbackIntegrationTest extends MediaWikiIntegrationTestCase {
use LanguageFallbackTestTrait;
private function getCallee( array $options = [] ) {
if ( isset( $options['siteLangCode'] ) ) {
$this->setMwGlobals( 'wgLanguageCode', $options['siteLangCode'] );
}
if ( isset( $options['fallbackMap'] ) ) {
$this->setService( 'LocalisationCache', $this->getMockLocalisationCache(
1, $options['fallbackMap'] ) );
}
return $this->getServiceContainer()->getLanguageFallback();
}
private function getMessagesKey() {
return LanguageFallback::MESSAGES;
}
private function getStrictKey() {
return LanguageFallback::STRICT;
}
}