public function testGetName() { $code = CountryCode::IT(); $name = CountryCodeName::getName($code); $expectedString = new StringLiteral('Italy'); $this->assertTrue($name->sameValueAs($expectedString)); }
/** * Returns a new Country object given a native PHP string country code * * @param string $code * @return self */ public static function fromNative() { $codeString = \func_get_arg(0); $code = CountryCode::getByName($codeString); $country = new self($code); return $country; }
/** * Returns country name * * @param CountryCode $code * @return StringLiteral */ public static function getName(CountryCode $code) { $codeValue = $code->toNative(); $name = self::$names[$codeValue]; return new StringLiteral($name); }
public function testGetCountry() { $country = new Country(CountryCode::IT()); $this->assertTrue($this->address->getCountry()->sameValueAs($country)); }
public function testToString() { $italy = new Country(CountryCode::IT()); $this->assertSame('Italy', $italy->__toString()); }