private DefinitionInstanceRegistry&MockObject
$definitionInstanceRegistry;
private ValidatorInterface&MockObject
$validator;
private DateIntervalFieldSerializer
$dateIntervalFieldSerializer;
protected function setUp(): void
{ $this->definitionInstanceRegistry =
$this->
createMock(DefinitionInstanceRegistry::
class);
$this->validator =
$this->
createMock(ValidatorInterface::
class);
$this->dateIntervalFieldSerializer =
new DateIntervalFieldSerializer( $this->validator,
$this->definitionInstanceRegistry
);
} public function testEncodeMethodWithCorrectDataWillReturnDateIntervalString(): void
{ $data =
new KeyValuePair('key',
new \
DateInterval('P2Y5D'
), false
);
$iterator =
$this->dateIntervalFieldSerializer->
encode( new DateIntervalField('fake', 'fake'
),