new Type(\DateTimeImmutable::
class),
new TypeGuess(DateType::
class,
['input' => 'datetime_immutable'
], Guess::MEDIUM_CONFIDENCE
)],
[new Type('\DateTime'
),
new TypeGuess(DateType::
class,
[], Guess::MEDIUM_CONFIDENCE
)],
];
} public static function guessRequiredProvider() { return [ [new NotNull(),
new ValueGuess(true, Guess::HIGH_CONFIDENCE
)],
[new NotBlank(),
new ValueGuess(true, Guess::HIGH_CONFIDENCE
)],
[new IsTrue(),
new ValueGuess(true, Guess::HIGH_CONFIDENCE
)],
[new Length(['min' => 10, 'max' => 10
]),
new ValueGuess(false, Guess::LOW_CONFIDENCE
)],
[new Range(['min' => 1, 'max' => 20
]),
new ValueGuess(false, Guess::LOW_CONFIDENCE
)],
];
} /**
* @dataProvider guessRequiredProvider
*/
public function testGuessRequired($constraint,
$guess) { // add distracting constraint
$this->metadata->
addPropertyConstraint(self::TEST_PROPERTY,
new Email());