diff --git a/src/CronExecutor.php b/src/CronExecutor.php index ca305cc..51f4e02 100644 --- a/src/CronExecutor.php +++ b/src/CronExecutor.php @@ -16,7 +16,7 @@ class CronExecutor extends Model public $table = 'cron'; - public $intervalSettings = [ + public array $intervalSettings = [ 'YEARLY' => 'Jährlich', 'MONTHLY' => 'Monatlich', 'WEEKLY' => 'Wöchentlich', @@ -25,7 +25,7 @@ class CronExecutor extends Model 'MINUTELY' => 'Minütlich' ]; - public $minutelyIntervalSettings = [ + public array $minutelyIntervalSettings = [ 'EVERY_MINUTE' => 'Jede Minute', 'EVERY_FIFTH_MINUTE' => 'Alle 5 Minuten', 'EVERY_FIFTEENTH_MINUTE' => 'Alle 15 Minuten' @@ -33,7 +33,7 @@ class CronExecutor extends Model //path(es) to folders where Cronjob php Files are located //format: path => namespace, e.g. 'src/data/cron' => 'YourProject\\Data\\Cron', - public $cronFilesPath = []; + public array $cronFilesPath = []; public $currentDate; public $currentWeekday; diff --git a/tests/CronExecutorTest.php b/tests/CronExecutorTest.php index c970923..4c32ddc 100644 --- a/tests/CronExecutorTest.php +++ b/tests/CronExecutorTest.php @@ -94,14 +94,14 @@ public function testRunYearly() public function testRunMonthly() { $persistence = $this->getSqliteTestPersistence(); - $testTime = new \DateTime('2020-05-05'); + $testTime = new \DateTime('2020-05-07'); $testTime->setTime(3, 3); //this one should be executed $cm1 = $this->_getRecord( $persistence, [ 'interval' => 'MONTHLY', - 'day_monthly' => 5, + 'day_monthly' => 7, 'time_monthly' => '03:03', ] ); @@ -109,7 +109,7 @@ public function testRunMonthly() $persistence, [ 'interval' => 'MONTHLY', - 'day_monthly' => 5, + 'day_monthly' => 7, 'time_monthly' => '03:02', ] ); @@ -117,7 +117,7 @@ public function testRunMonthly() $persistence, [ 'interval' => 'MONTHLY', - 'day_monthly' => 5, + 'day_monthly' => 7, 'time_monthly' => '03:04', ] ); @@ -125,7 +125,7 @@ public function testRunMonthly() $persistence, [ 'interval' => 'MONTHLY', - 'day_monthly' => 4, + 'day_monthly' => 8, 'time_monthly' => '03:03', ] );