CommerceGuys\Addressing\Tests\Validator\Constraints\AddressFormatConstraintValidatorTest::testIrishAddress PHP Method

testIrishAddress() public method

public testIrishAddress ( )
    public function testIrishAddress()
    {
        $address = new Address();
        $address = $address->withCountryCode('IE')->withAdministrativeArea('Co. Donegal')->withLocality('Dublin')->withAddressLine1('7424 118 Avenue NW')->withGivenName('Conan')->withFamilyName("O'Brien");
        $this->validator->validate($address, $this->constraint);
        $this->assertNoViolation();
        // Test the same address but leave the county empty. This address should be valid
        // since county is not required.
        $address = $address->withAdministrativeArea(null);
        $this->validator->validate($address, $this->constraint);
        $this->assertNoViolation();
    }