/** * {@inheritdoc} */ public function getLanguageNames($locale = null) { if (null === $locale) { $locale = \Locale::getDefault(); } $languages = parent::getLanguageNames($locale); $collator = new \Collator($locale); $collator->asort($languages); // "mul" is the code for multiple languages unset($languages['mul']); return $languages; }
public function testGetLanguageNames() { $sortedLanguages = array('en' => 'English', 'de' => 'German'); $this->reader->expects($this->once())->method('readEntry')->with(self::RES_DIR, 'en', array('Languages'))->will($this->returnValue($sortedLanguages)); $this->assertSame($sortedLanguages, $this->bundle->getLanguageNames('en')); }