constraint = new CountryConstraint(); // The following code is copied from the parent setUp(), which isn't // called to avoid the call to \Locale, which introduces a dependency // on the intl extension (or symfony/intl). $this->group = 'MyGroup'; $this->metadata = null; $this->object = null; $this->value = 'InvalidValue'; $this->root = 'root'; $this->propertyPath = ''; $this->context = $this->createContext(); $this->validator = $this->createValidator(); $this->validator->initialize($this->context); $this->defaultLocale = 'en'; $this->expectedViolations = []; $this->call = 0; $this->setDefaultTimezone('UTC'); } protected function tearDown(): void { $this->restoreDefaultTimezone(); } protected function createValidator() { return new CountryConstraintValidator(); } /** * @covers \CommerceGuys\Addressing\Validator\Constraints\CountryConstraintValidator */ public function testEmptyIsValid() { $this->validator->validate(null, $this->constraint); $this->assertNoViolation(); $this->validator->validate('', $this->constraint); $this->assertNoViolation(); } /** * @covers \CommerceGuys\Addressing\Validator\Constraints\CountryConstraintValidator */ public function testInvalidValueType() { $this->expectException(\Symfony\Component\Validator\Exception\UnexpectedTypeException::class); $this->validator->validate(new \stdClass(), $this->constraint); } /** * @covers \CommerceGuys\Addressing\Validator\Constraints\CountryConstraintValidator */ public function testInvalidCountry() { $this->validator->validate('InvalidValue', $this->constraint); $this->buildViolation($this->constraint->message) ->setParameters(['{{ value }}' => '"InvalidValue"']) ->atPath('') ->assertRaised(); } /** * @covers \CommerceGuys\Addressing\Validator\Constraints\CountryConstraintValidator * * @dataProvider getValidCountries */ public function testValidCountries($country) { $this->validator->validate($country, $this->constraint); $this->assertNoViolation(); } public function getValidCountries(): array { return [ ['GB'], ['AT'], ['MY'], ]; } } __halt_compiler();----SIGNATURE:----MuOzxgs5cBytPNrdfIWrkHei4YTV2dHgD6XDxMjFou/LAn0Bx3DrHlGAppakTnFqsTM5sWvKqbdfH+c06mb639FMmRd8f+lp8lnYrNaZTeXtDEDStc317bEa13n1XQvNn79aMZ/bWqfezBr3S1Oy+4lfG5gfhXwFRV79DYwt/C14AGNKd9TJSCmEKUjFseZfhMXWxIYhXjJ2HPpmK0nYuEm4vDwCf8mGXWH4C86Upyc7DSqoZ+TbUWkSH1WiydbZkbQ5r2qtSmdzZHN4SUbY+QB9qsAAYXMX0sj/F3ks7PvlSQykym//KuLdRHljUOrsrsYvN2fhmHY9WDaiHi0BRx/a7gZRQfKwv8YF3ehcq3kmhrYW5NGuJtHvNIBkOY2OcIyagH8M+ORWmwthy7DQhVsEXrgJX8breGCO7hlQidQrDiAN5USGcaTXoGd3zFtWB1xLiU9UYl2MC7ImMIBW17ZZj3hbPowgrSvmxeLA9LE6i9SRG0XTQ0WZKscXWjJPzuxPH7FpQl6ohY0cukJXKyxnwfWTH+iocATNYUvLM5p+kg2ywxYuC22dI4z96rCvYfuEehb1dbV22NweJN2EYGnlQKxYML7iCpoaXiJ5ubpcJy1X8Ds+eNoa2zpdkzxos9hjQ6bQx0CJs7Y4F9423tvIxavHrK5Bj97rHxVW4h0=----ATTACHMENT:----ODAyODgwODk3Njk3Nzk2MSA1ODIxNTY4MjEyMTQxODg2IDMyNzc3MTQ2NjE1NDEzMzU=