95 : void
96 {
97 $job_instance = $this->createMock(CronJob::class);
98 $job_instance->method('hasFlexibleSchedule')->willReturn(true);
99
100 $entity = $this->
getEntity($job_instance);
101 $this->assertSame(JobScheduleType::IN_MINUTES, $entity->getEffectiveScheduleType());
102 $this->assertSame(5, $entity->getEffectiveScheduleValue());
103
104 $another_job_instance = $this->createMock(CronJob::class);
105 $another_job_instance->method('hasFlexibleSchedule')->willReturn(false);
106 $another_job_instance->method('getDefaultScheduleType')->willReturn(
107 JobScheduleType::IN_HOURS
108 );
109 $another_job_instance->method('getDefaultScheduleValue')->willReturn(5);
110
111 $another_entity = $this->
getEntity($another_job_instance, JobScheduleType::DAILY->value);
112 $this->assertSame(JobScheduleType::IN_HOURS, $another_entity->getEffectiveScheduleType());
113 $this->assertSame(5, $another_entity->getEffectiveScheduleValue());
114
115 $yet_another_job_instance = $this->createMock(CronJob::class);
116 $yet_another_job_instance->method('hasFlexibleSchedule')->willReturn(true);
117 $yet_another_job_instance->method('getDefaultScheduleType')->willReturn(
118 JobScheduleType::IN_HOURS
119 );
120 $yet_another_job_instance->method('getDefaultScheduleValue')->willReturn(5);
121
122 $yet_another_entity = $this->
getEntity($yet_another_job_instance, 0);
123 $this->assertSame(JobScheduleType::IN_HOURS, $yet_another_entity->getEffectiveScheduleType());
124 $this->assertSame(5, $yet_another_entity->getEffectiveScheduleValue());
125 }