*/ #[CoversClass(CustomerConstraint::class)] #[CoversClass(CustomerValidator::class)] class CustomerValidatorTest extends ConstraintValidatorTestCase { protected function createValidator(): CustomerValidator { $loader = $this->createMock(ConfigLoaderInterface::class); $config = SystemConfigurationFactory::create($loader, []); $repository = $this->createMock(CustomerRepository::class); return new CustomerValidator($config, $repository); } public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new NotBlank()); } public function testGetTargets(): void { $constraint = new CustomerConstraint(); self::assertEquals('class', $constraint->getTargets()); } }