->
setCode(Unique::IS_NOT_UNIQUE
) ->
assertRaised();
} public static function getCallback(): array
{ return [ 'static function' =>
[static fn (\stdClass
$object) =>
[$object->name,
$object->email
]],
'callable with string notation' =>
['Symfony\Component\Validator\Tests\Constraints\CallableClass::execute'
],
'callable with static notation' =>
[[CallableClass::
class, 'execute'
]],
'callable with first-class callable notation' =>
[CallableClass::
execute(...
)],
'callable with object' =>
[[new CallableClass(), 'execute'
]],
];
} public function testExpectsInvalidNonStrictComparison() { $this->validator->
validate([1, '1', 1.0, '1.0'
],
new Unique([ 'message' => 'myMessage',
'normalizer' => 'intval',
]));
$this->
buildViolation('myMessage'
)