public function testFromString($inputString, $expectedResult) { $this->given($country = TestedCountryAssembler::fromString($inputString))->string($country->__toString())->isIdenticalTo($expectedResult); }
/** * 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)); }