private ClassMetadata
$metadata;
/**
* @var MetadataFactoryInterface
*/
private \Symfony\Component\Validator\Tests\Fixtures\FakeMetadataFactory
$metadataFactory;
protected function setUp(): void
{ $this->metadata =
new ClassMetadata(self::TEST_CLASS
);
$this->metadataFactory =
new FakeMetadataFactory();
$this->metadataFactory->
addMetadata($this->metadata
);
$this->guesser =
new ValidatorTypeGuesser($this->metadataFactory
);
} /**
* @dataProvider guessTypeProvider
*/
public function testGuessType(Constraint
$constraint, TypeGuess
$guess) { $this->metadata->
addPropertyConstraint(self::TEST_PROPERTY,
$constraint);
$this->
assertEquals($guess,
$this->guesser->
guessType(self::TEST_CLASS, self::TEST_PROPERTY
));
}