Пример #1
0
 public function getValueOptions()
 {
     if ($this->valueOptions !== null) {
         return $this->valueOptions;
     }
     $countryCodes = $this->addressService->getCountryCodes();
     $valueOptions = [];
     foreach ($countryCodes as $countryCode) {
         $valueOptions[$countryCode] = $this->countryCodeFormatter->format($countryCode);
     }
     $this->setValueOptions($valueOptions);
     return $this->valueOptions;
 }
Пример #2
0
 /**
  * @covers ::format
  */
 public function testFormatThrowsExceptionOnInvalidCountryCode()
 {
     $this->setExpectedException('UnexpectedValueException', 'Invalid country code provided: "foobar"');
     $formatter = new CountryCodeFormatter('en-US');
     $formatter->format('foobar');
 }