Skip to content

Commit fc189fc

Browse files
tests: check correct cron syntax in Dispatcher
1 parent 5b10fd4 commit fc189fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APICoreDispatcherTestCase.inc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,14 @@ class APICoreDispatcherTestCase extends TestCase {
134134
$this->assert_equals($dispatcher->setup_schedule(), null);
135135

136136
# Assign the dispatcher a schedule and ensure setup_schedule() returns a CronJob object with the correct schedule
137-
$dispatcher->schedule = '* 12 * * *';
137+
$dispatcher->schedule = '1 2 3 4 5';
138138
$dispatcher_cron_job = $dispatcher->setup_schedule();
139139
$cron_job_cmd = '/usr/local/pkg/RESTAPI/.resources/scripts/manage.php notifydispatcher Dispatcher';
140-
$this->assert_equals($dispatcher_cron_job->minute->value, $dispatcher->schedule);
140+
$this->assert_equals($dispatcher_cron_job->minute->value, "1");
141+
$this->assert_equals($dispatcher_cron_job->hour->value, "2");
142+
$this->assert_equals($dispatcher_cron_job->mday->value, "3");
143+
$this->assert_equals($dispatcher_cron_job->month->value, "4");
144+
$this->assert_equals($dispatcher_cron_job->wday->value, "5");
141145
$this->assert_equals($dispatcher_cron_job->command->value, $cron_job_cmd);
142146

143147
# Delete the CronJob

0 commit comments

Comments
 (0)