예제 #1
0
 public function testFromString($inputString, $expectedResult)
 {
     $this->given($country = TestedCountryAssembler::fromString($inputString))->string($country->__toString())->isIdenticalTo($expectedResult);
 }
예제 #2
0
 /**
  * Basic sample Address creation from a string, feel free to implement your own
  * @param  string $string
  * @return Address
  */
 public static function fromString($string)
 {
     list($street, $city, $postalcode, $region, $country, $coordinates, ) = explode(PHP_EOL, $string) + [null, null, null, null, null, null];
     return new AddressValueObject(Assembler\Street::fromString($street), $city, $postalcode, $region, Assembler\Country::fromString($country), Assembler\Coordinates::fromString($coordinates));
 }