Пример #1
0
 /**
  * Creates a country object from the provided definition.
  *
  * @param array  $definition The country definition.
  * @param string $locale     The locale of the country definition.
  *
  * @return Country
  */
 protected function createCountryFromDefinition(array $definition, $locale)
 {
     $country = new Country();
     $country->setCountryCode($definition['code']);
     $country->setName($definition['name']);
     $country->setLocale($locale);
     if (isset($definition['three_letter_code'])) {
         $country->setThreeLetterCode($definition['three_letter_code']);
     }
     if (isset($definition['numeric_code'])) {
         $country->setNumericCode($definition['numeric_code']);
     }
     if (isset($definition['telephone_code'])) {
         $country->setTelephoneCode($definition['telephone_code']);
     }
     return $country;
 }
Пример #2
0
 /**
  * @covers ::getLocale
  * @covers ::setLocale
  */
 public function testLocale()
 {
     $this->country->setLocale('en');
     $this->assertEquals('en', $this->country->getLocale());
 }