[ 'class' => 'FileBasedMessageGroup', 'id' => 'test-id', 'label' => 'Test Label', 'namespace' => 'NS_MEDIAWIKI', 'description' => 'Test description', ], 'FILES' => [ 'class' => 'TestFFS', ], ]; protected function setUp() { parent::setUp(); $this->group = MessageGroupBase::factory( $this->groupConfiguration ); $this->codes = array_flip( array_keys( TranslateUtils::getLanguageNames( 'en' ) ) ); } protected function tearDown() { unset( $this->group ); parent::tearDown(); } public function testNoLanguageConf() { $translatableLanguages = $this->group->getTranslatableLanguages(); $this->assertNull( $translatableLanguages ); } public function testAllBlackList() { $conf = $this->groupConfiguration; $conf['LANGUAGES'] = [ 'blacklist' => '*', ]; $group = MessageGroupBase::factory( $conf ); $translatableLanguages = $group->getTranslatableLanguages(); $this->assertEquals( count( $translatableLanguages ), 0 ); } public function testAllWhiteList() { $conf = $this->groupConfiguration; $conf['LANGUAGES'] = [ 'whitelist' => '*', ]; $group = MessageGroupBase::factory( $conf ); $translatableLanguages = $group->getTranslatableLanguages(); $this->assertNull( $translatableLanguages ); } public function testWhiteListOverrideBlackList() { $conf = $this->groupConfiguration; $conf['LANGUAGES'] = [ 'whitelist' => [ 'en', 'hi', 'ta' ], 'blacklist' => [ 'ta' ], ]; $group = MessageGroupBase::factory( $conf ); $translatableLanguages = $group->getTranslatableLanguages(); $this->assertTrue( isset( $translatableLanguages['ta'] ) ); $this->assertTrue( isset( $translatableLanguages['hi'] ) ); } public function testSomeBlackList() { $conf = $this->groupConfiguration; $conf['LANGUAGES'] = [ 'blacklist' => [ 'or', 'hi' ], ]; $group = MessageGroupBase::factory( $conf ); $translatableLanguages = $group->getTranslatableLanguages(); $this->assertTrue( !isset( $translatableLanguages['hi'] ) ); $this->assertTrue( isset( $translatableLanguages['he'] ) ); } }