Skip to content

Commit

Permalink
found bug in monthly implementation, not fixed yet!
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGrashoff committed Oct 2, 2022
1 parent 4123f4e commit 67c41c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/CronExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CronExecutor extends Model

public $table = 'cron';

public $intervalSettings = [
public array $intervalSettings = [
'YEARLY' => 'Jährlich',
'MONTHLY' => 'Monatlich',
'WEEKLY' => 'Wöchentlich',
Expand All @@ -25,15 +25,15 @@ 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'
];

//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;
Expand Down
10 changes: 5 additions & 5 deletions tests/CronExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,38 +94,38 @@ 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',
]
);
$cm2 = $this->_getRecord(
$persistence,
[
'interval' => 'MONTHLY',
'day_monthly' => 5,
'day_monthly' => 7,
'time_monthly' => '03:02',
]
);
$cm3 = $this->_getRecord(
$persistence,
[
'interval' => 'MONTHLY',
'day_monthly' => 5,
'day_monthly' => 7,
'time_monthly' => '03:04',
]
);
$cm4 = $this->_getRecord(
$persistence,
[
'interval' => 'MONTHLY',
'day_monthly' => 4,
'day_monthly' => 8,
'time_monthly' => '03:03',
]
);
Expand Down

0 comments on commit 67c41c5

Please sign in to comment.