示例#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 ::getCountryCodes
  */
 public function testGetCountryCodesOnlyAccessesFilesystemOnce()
 {
     $addressService = new AddressService($this->options);
     $this->assertSame(['US', 'UK', 'DE', 'FR'], $addressService->getCountryCodes());
     $this->root->removeChild($this->root->url() . '/country-codes.php');
     $this->assertSame(['US', 'UK', 'DE', 'FR'], $addressService->getCountryCodes());
 }