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

testUnitedStatesNotOK() public method

    public function testUnitedStatesNotOK()
    {
        $address = new Address();
        $address = $address->withCountryCode('US')->withAdministrativeArea('CA')->withPostalCode('909')->withGivenName('John')->withFamilyName('Smith');
        $this->validator->validate($address, $this->constraint);
        $this->buildViolation($this->constraint->notBlankMessage)->atPath('[addressLine1]')->setInvalidValue(null)->buildNextViolation($this->constraint->notBlankMessage)->atPath('[locality]')->setInvalidValue(null)->buildNextViolation($this->constraint->invalidMessage)->atPath('[postalCode]')->setInvalidValue('909')->assertRaised();
    }