Ejemplo n.º 1
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));
 }
Ejemplo n.º 2
0
 public function testFromArray($inputArray, $expectedResult)
 {
     $this->given($street = TestedStreetAssembler::fromArray($inputArray))->string($street->__toString())->isIdenticalTo($expectedResult);
 }