コード例 #1
0
 public function testGetCurrencyNames()
 {
     $sortedCurrencies = array('USD' => array(0 => 'Dollar'), 'EUR' => array(0 => 'Euro'));
     $this->reader->expects($this->once())->method('readEntry')->with(self::RES_DIR, 'en', array('Currencies'))->will($this->returnValue($sortedCurrencies));
     $sortedNames = array('USD' => 'Dollar', 'EUR' => 'Euro');
     $this->assertSame($sortedNames, $this->bundle->getCurrencyNames('en'));
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function getCurrencyNames($locale = null)
 {
     if (null === $locale) {
         $locale = \Locale::getDefault();
     }
     $names = parent::getCurrencyNames($locale);
     $collator = new \Collator($locale);
     $collator->asort($names);
     return $names;
 }