#25645tx_scheduler_CronCmd does not correctly parse step values
Description
Problem:
Step values of cron command are not always calculated correctly in getList():
Step values of cron command are not always calculated correctly in getList():
- * */14 * * should result in days 14,28
- * 2,4-5,*/14 * * should result in days 2,4,5,14,28
/**
* Tests whether dayList is correctly calculated for stops of month days
*
* @test
/
public function isDayListCorrectForStepsOfDayOfMonth() {
$cronCmdInstance = t3lib_div::makeInstance(‘tx_scheduler_cronCmd’, ‘ * */14 * *’);
$expectedResult = array(
‘0’ => 14,
‘1’ => 28,
);
$actualResult = $cronCmdInstance->valid_values;
$this->assertEquals($expectedResult, $actualResult2);
}
/**
* Tests whether dayList is correctly calculated for stops of month days combined with ranges and lists
*
* @test
/
public function isDayListCorrectForStepsOfDayOfMonthCombinedWithLists() {
$cronCmdInstance = t3lib_div::makeInstance(‘tx_scheduler_cronCmd’, ‘ * 2,4-5,*/14 * *’);
$expectedResult = array(
‘0’ => 2,
‘1’ => 4,
‘2’ => 5,
‘3’ => 14,
‘4’ => 28,
);
$actualResult = $cronCmdInstance->valid_values;
$this->assertEquals($expectedResult, $actualResult2);
}
(issue imported from #M13194)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.