yield [Types::DATETIMETZ_IMMUTABLE,
new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType',
['input' => 'datetime_immutable'
], Guess::HIGH_CONFIDENCE
)];
yield [Types::DATETIME_MUTABLE,
new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType',
[], Guess::HIGH_CONFIDENCE
)];
yield [Types::DATETIMETZ_MUTABLE,
new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType',
[], Guess::HIGH_CONFIDENCE
)];
} public function testRequiredGuesserSimpleFieldNotNullable() { $classMetadata =
$this->
createMock(ClassMetadata::
class);
$classMetadata->fieldMappings
['field'
] = true;
$classMetadata->
expects($this->
once())->
method('isNullable'
)->
with('field'
)->
willReturn(false
);
$this->
assertEquals(new ValueGuess(true, Guess::HIGH_CONFIDENCE
),
$this->
getGuesser($classMetadata)->
guessRequired('TestEntity', 'field'
));
} public function testRequiredGuesserSimpleFieldNullable() { $classMetadata =
$this->
createMock(ClassMetadata::
class);
$classMetadata->fieldMappings
['field'
] = true;
$classMetadata->
expects($this->
once())->
method('isNullable'
)->
with('field'
)->
willReturn(true
);
$this->
assertEquals(new ValueGuess(false, Guess::MEDIUM_CONFIDENCE
),
$this->
getGuesser($classMetadata)->
guessRequired('TestEntity', 'field'
));
}