Esempio n. 1
0
 /**
  * Get currency symbol
  *
  * @param  string $code
  * @return string
  */
 public function getCurrencySymbol($code)
 {
     if (empty($this->currencies)) {
         $this->currencies = StubLocale::getCurrenciesData('en');
     }
     if (isset($this->currencies[$code]['symbol'])) {
         return $this->currencies[$code]['symbol'];
     }
 }
 /**
  * Returns the rounding increment of a currency
  *
  * @param  string   $currency   The 3-letter ISO 4217 currency code indicating the currency to use
  *
  * @return string               The rounding increment of a currency
  */
 private function getCurrencyRoundingIncrement($currency)
 {
     $currencies = StubLocale::getCurrenciesData($this->locale);
     return $currencies[$currency]['roundingIncrement'];
 }
Esempio n. 3
0
 public function testGetCurrencies()
 {
     $currencies = StubLocale::getCurrencies();
     $this->assertTrue(in_array('BRL', $currencies));
 }
Esempio n. 4
0
 /**
  * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
  */
 public function testSetDefault()
 {
     StubLocale::setDefault('pt_BR');
 }
 public function testSetDefaultAcceptsEn()
 {
     StubLocale::setDefault('en');
 }