public function testForwardsToOriginalValidator() { $originalValidator =
$this->
createMock(ValidatorInterface::
class);
$validator =
new TraceableValidator($originalValidator);
$expects =
fn ($method) =>
$originalValidator->
expects($this->
once())->
method($method);
$expects('getMetadataFor'
)->
willReturn($expected =
$this->
createMock(MetadataInterface::
class));
$this->
assertSame($expected,
$validator->
getMetadataFor('value'
), 'returns original validator getMetadataFor() result'
);
$expects('hasMetadataFor'
)->
willReturn($expected = false
);
$this->
assertSame($expected,
$validator->
hasMetadataFor('value'
), 'returns original validator hasMetadataFor() result'
);
$expects('inContext'
)->
willReturn($expected =
$this->
createMock(ContextualValidatorInterface::
class));
$this->
assertSame($expected,
$validator->
inContext($this->
createMock(ExecutionContextInterface::
class)), 'returns original validator inContext() result'
);
$expects('startContext'
)->
willReturn($expected =
$this->
createMock(ContextualValidatorInterface::
class));
$this->
assertSame($expected,
$validator->
startContext(), 'returns original validator startContext() result'
);
$expects('validate'
)->
willReturn($expected =
new ConstraintViolationList());
$this->
assertSame($expected,
$validator->
validate('value'
), 'returns original validator validate() result'
);
$expects('validateProperty'
)->
willReturn($expected =
new ConstraintViolationList());