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

testChinaPostalCodeBadFormat() public method

    public function testChinaPostalCodeBadFormat()
    {
        $address = new Address();
        $address = $address->withCountryCode('CN')->withAdministrativeArea('Beijing Shi')->withLocality('Xicheng Qu')->withPostalCode('InvalidValue')->withGivenName('John')->withFamilyName('Smith');
        $this->validator->validate($address, $this->constraint);
        $this->buildViolation($this->constraint->notBlankMessage)->atPath('[addressLine1]')->setInvalidValue(null)->buildNextViolation($this->constraint->invalidMessage)->atPath('[postalCode]')->assertRaised();
    }