$this->definitionInstanceRegistry =
$this->
createMock(DefinitionInstanceRegistry::
class);
$this->validator =
$this->
createMock(ValidatorInterface::
class);
$this->intervalFieldSerializer =
new CronIntervalFieldSerializer( $this->validator,
$this->definitionInstanceRegistry
);
} public function testEncodeMethodWithCorrectDataWillReturnCronIntervalString(): void
{ $data =
new KeyValuePair('key',
new CronExpression(self::COMPLEX_CRON
), false
);
$cronExpression =
$this->intervalFieldSerializer->
encode( new CronIntervalField('fake', 'fake'
),
$this->
createStub(EntityExistence::
class),
$data,
$this->
createMock(WriteParameterBag::
class) )->
current();
static::
assertIsString($cronExpression);
static::
assertEquals(self::COMPLEX_CRON,
$cronExpression);
}