Project

General

Profile

Actions

Bug #25645

closed

tx_scheduler_CronCmd does not correctly parse step values

Added by Christian Kuhn almost 15 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Category:
scheduler
Target version:
-
Start date:
2010-01-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Problem:
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, $actualResult[2]);
}
/**
 * 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, $actualResult[2]);
}

(issue imported from #M13194)

Actions

Also available in: Atom PDF