Example #1
0
 /**
  * @covers ::getValueOptions
  */
 public function testGetValueOptionsFormatsValues()
 {
     $this->addressService->expects($this->once())->method('getCountryCodes')->will($this->returnValue(['US', 'DE']));
     $this->countryCodeFormatter->expects($this->any())->method('format')->will($this->returnCallback(function ($countryCode) {
         if ($countryCode === 'US') {
             return 'United States';
         }
         return 'Germany';
     }));
     $countrySelect = new CountrySelect($this->addressService, $this->countryCodeFormatter);
     $this->assertSame(['US' => 'United States', 'DE' => 'Germany'], $countrySelect->getValueOptions());
 }