‪TYPO3CMS  11.5
TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest Class Reference
Inheritance diagram for TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest:

Public Member Functions

 normalizeConvertsCronCommand (string $expression, string $expected)
 
 convertKeywordsToCronCommandConvertsValidKeywords (string $keyword, string $expectedCronCommand)
 
 convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound ()
 
array normalizeFieldsValidDataProvider ()
 
 normalizeFieldsConvertsField (string $expression, string $expected)
 
 normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression (string $expression, bool $isMonthField, string $expected)
 
 normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression (string $expression, bool $isMonthField, int $expectedExceptionCode)
 
 normalizeIntegerFieldReturnsNormalizedListForValidExpression ($expression, string $expected)
 
 normalizeIntegerFieldThrowsExceptionForInvalidExpressions (string $expression, int $lowerBound, int $upperBound, int $expectedExceptionCode)
 
 splitFieldsReturnsIntegerArrayWithFieldsSplitByWhitespace ()
 
 splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields ($cronCommand)
 
 convertRangeToListOfValuesReturnsCorrectListForValidRanges ($range, string $expected)
 
 convertRangeToListOfValuesThrowsExceptionForInvalidRanges (string $range, int $expectedExceptionCode)
 
 reduceListOfValuesByStepValueReturnsCorrectListOfValues (string $stepExpression, string $expected)
 
 reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions (string $stepExpression, int $expectedExceptionCode)
 
 normalizeMonthAndWeekdayNormalizesAMonth ()
 
 normalizeMonthAndWeekdayNormalizesAWeekday ()
 
 normalizeMonthAndWeekdayLeavesValueUnchanged ()
 
 normalizeMonthConvertsName ($monthName, int $expectedInteger)
 
 normalizeMonthReturnsInteger ($monthName)
 
 normalizeMonthThrowsExceptionForInvalidMonthRepresentation ( $invalidMonthName, int $expectedExceptionCode)
 
 normalizeWeekdayConvertsName ($weekday, int $expectedInteger)
 
 normalizeWeekdayReturnsInteger ($weekday)
 
 normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation ($weekday)
 

Static Public Member Functions

static array normalizeValidDataProvider ()
 
static array validSpecialKeywordsDataProvider ()
 
static array normalizeMonthAndWeekdayFieldValidDataProvider ()
 
static array normalizeMonthAndWeekdayFieldInvalidDataProvider ()
 
static array normalizeIntegerFieldValidDataProvider ()
 
static array normalizeIntegerFieldInvalidDataProvider ()
 
static array invalidCronCommandFieldsDataProvider ()
 
static array validRangeDataProvider ()
 
static array invalidRangeDataProvider ()
 
static array validStepsDataProvider ()
 
static array invalidStepsDataProvider ()
 
static array validMonthNamesDataProvider ()
 
static array invalidMonthNamesDataProvider ()
 
static array validWeekdayDataProvider ()
 
static array invalidWeekdayDataProvider ()
 

Detailed Description

Test case

Definition at line 27 of file NormalizeCommandTest.php.

Member Function Documentation

◆ convertKeywordsToCronCommandConvertsValidKeywords()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::convertKeywordsToCronCommandConvertsValidKeywords ( string  $keyword,
string  $expectedCronCommand 
)
Test:
‪@dataProvider validSpecialKeywordsDataProvider
Parameters
string$keyword‪Cron command keyword
string$expectedCronCommand‪Expected result (normalized cron command syntax)

Definition at line 98 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\convertKeywordsToCronCommand().

◆ convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound ( )

◆ convertRangeToListOfValuesReturnsCorrectListForValidRanges()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::convertRangeToListOfValuesReturnsCorrectListForValidRanges (   $range,
string  $expected 
)
Test:
‪@dataProvider validRangeDataProvider
Parameters
string | int$range‪Cron command range expression
string$expected‪Expected result (normalized range)

Definition at line 352 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\convertRangeToListOfValues().

◆ convertRangeToListOfValuesThrowsExceptionForInvalidRanges()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::convertRangeToListOfValuesThrowsExceptionForInvalidRanges ( string  $range,
int  $expectedExceptionCode 
)
Test:
‪@dataProvider invalidRangeDataProvider
Parameters
string$range‪Cron command range expression (invalid)
int$expectedExceptionCode‪Expected exception code from provider

Definition at line 383 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\convertRangeToListOfValues().

◆ invalidCronCommandFieldsDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::invalidCronCommandFieldsDataProvider ( )
static
Returns
‪array

Definition at line 308 of file NormalizeCommandTest.php.

◆ invalidMonthNamesDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::invalidMonthNamesDataProvider ( )
static
Returns
‪array

Definition at line 527 of file NormalizeCommandTest.php.

◆ invalidRangeDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::invalidRangeDataProvider ( )
static
Returns
‪array

Definition at line 361 of file NormalizeCommandTest.php.

◆ invalidStepsDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::invalidStepsDataProvider ( )
static
Returns
‪array

Definition at line 418 of file NormalizeCommandTest.php.

◆ invalidWeekdayDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::invalidWeekdayDataProvider ( )
static
Returns
‪array

Definition at line 629 of file NormalizeCommandTest.php.

◆ normalizeConvertsCronCommand()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeConvertsCronCommand ( string  $expression,
string  $expected 
)
Test:
‪@dataProvider normalizeValidDataProvider
Parameters
string$expression‪Cron command to test
string$expected‪Expected result (normalized cron command syntax)

Definition at line 70 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\CronCommand\NormalizeCommand\normalize().

◆ normalizeFieldsConvertsField()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeFieldsConvertsField ( string  $expression,
string  $expected 
)
Test:
‪@dataProvider normalizeFieldsValidDataProvider
Parameters
string$expression‪Cron command to normalize
string$expected‪Expected result (normalized cron command syntax)

Definition at line 134 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeFields().

◆ normalizeFieldsValidDataProvider()

array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeFieldsValidDataProvider ( )
Returns
‪array

Definition at line 117 of file NormalizeCommandTest.php.

◆ normalizeIntegerFieldInvalidDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeIntegerFieldInvalidDataProvider ( )
static
Returns
‪array

Definition at line 253 of file NormalizeCommandTest.php.

◆ normalizeIntegerFieldReturnsNormalizedListForValidExpression()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeIntegerFieldReturnsNormalizedListForValidExpression (   $expression,
string  $expected 
)
Test:
‪@dataProvider normalizeIntegerFieldValidDataProvider
Parameters
string | int$expression‪Cron command partial integer expression
string$expected‪Expected result (normalized integer or integer list)

Definition at line 244 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeIntegerField().

◆ normalizeIntegerFieldThrowsExceptionForInvalidExpressions()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeIntegerFieldThrowsExceptionForInvalidExpressions ( string  $expression,
int  $lowerBound,
int  $upperBound,
int  $expectedExceptionCode 
)
Test:
‪@dataProvider normalizeIntegerFieldInvalidDataProvider
Parameters
string$expression‪Cron command partial integer expression (invalid)
int$lowerBound‪Lower limit
int$upperBound‪Upper limit
int$expectedExceptionCode‪Expected exception code

Definition at line 277 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeIntegerField().

◆ normalizeIntegerFieldValidDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeIntegerFieldValidDataProvider ( )
static
Returns
‪array

Definition at line 219 of file NormalizeCommandTest.php.

◆ normalizeMonthAndWeekdayFieldInvalidDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayFieldInvalidDataProvider ( )
static
Returns
‪array

Definition at line 187 of file NormalizeCommandTest.php.

◆ normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression ( string  $expression,
bool  $isMonthField,
string  $expected 
)
Test:
‪@dataProvider normalizeMonthAndWeekdayFieldValidDataProvider
Parameters
string$expression‪Cron command partial expression for month and weekday fields
bool$isMonthField‪Flag to designate month field or not
string$expected‪Expected result (normalized months or weekdays)

Definition at line 175 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

◆ normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression ( string  $expression,
bool  $isMonthField,
int  $expectedExceptionCode 
)
Test:
‪@dataProvider normalizeMonthAndWeekdayFieldInvalidDataProvider
Parameters
string$expression‪Cron command partial expression for month and weekday fields (invalid)
bool$isMonthField‪Flag to designate month field or not
int$expectedExceptionCode‪Expected exception code from provider

Definition at line 206 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

◆ normalizeMonthAndWeekdayFieldValidDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayFieldValidDataProvider ( )
static
Returns
‪array

Definition at line 143 of file NormalizeCommandTest.php.

◆ normalizeMonthAndWeekdayLeavesValueUnchanged()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayLeavesValueUnchanged ( )

◆ normalizeMonthAndWeekdayNormalizesAMonth()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayNormalizesAMonth ( )

◆ normalizeMonthAndWeekdayNormalizesAWeekday()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayNormalizesAWeekday ( )

◆ normalizeMonthConvertsName()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthConvertsName (   $monthName,
int  $expectedInteger 
)
Test:
‪@dataProvider validMonthNamesDataProvider
Parameters
string | int$monthName‪Month name
int$expectedInteger‪Number of the month

Definition at line 507 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonth().

◆ normalizeMonthReturnsInteger()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthReturnsInteger (   $monthName)
Test:
‪@dataProvider validMonthNamesDataProvider
Parameters
string | int$monthName‪Month name

Definition at line 518 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonth().

◆ normalizeMonthThrowsExceptionForInvalidMonthRepresentation()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthThrowsExceptionForInvalidMonthRepresentation (   $invalidMonthName,
int  $expectedExceptionCode 
)
Test:
‪@dataProvider invalidMonthNamesDataProvider
Parameters
string | int$invalidMonthName‪Month name (invalid)
int$expectedExceptionCode‪Expected exception code

Definition at line 558 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonth().

◆ normalizeValidDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeValidDataProvider ( )
static
Returns
‪array

Definition at line 32 of file NormalizeCommandTest.php.

◆ normalizeWeekdayConvertsName()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeWeekdayConvertsName (   $weekday,
int  $expectedInteger 
)
Test:
‪@dataProvider validWeekdayDataProvider
Parameters
string | int$weekday‪Weekday expression
int$expectedInteger‪Number of weekday

Definition at line 609 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeWeekday().

◆ normalizeWeekdayReturnsInteger()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeWeekdayReturnsInteger (   $weekday)
Test:
‪@dataProvider validWeekdayDataProvider
Parameters
string | int$weekday‪Weekday expression

Definition at line 620 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeWeekday().

◆ normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation (   $weekday)
Test:
‪@dataProvider invalidWeekdayDataProvider
Parameters
string | int$weekday‪Weekday expression (invalid)

Definition at line 657 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeWeekday().

◆ reduceListOfValuesByStepValueReturnsCorrectListOfValues()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::reduceListOfValuesByStepValueReturnsCorrectListOfValues ( string  $stepExpression,
string  $expected 
)
Test:
‪@dataProvider validStepsDataProvider
Parameters
string$stepExpression‪Cron command step expression
string$expected‪Expected result (normalized range)

Definition at line 409 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue().

◆ reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions ( string  $stepExpression,
int  $expectedExceptionCode 
)
Test:
‪@dataProvider invalidStepsDataProvider
Parameters
string$stepExpression‪Cron command step expression (invalid)
int$expectedExceptionCode‪Expected exception code

Definition at line 439 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue().

◆ splitFieldsReturnsIntegerArrayWithFieldsSplitByWhitespace()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::splitFieldsReturnsIntegerArrayWithFieldsSplitByWhitespace ( )

◆ splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields (   $cronCommand)
Test:
‪@dataProvider invalidCronCommandFieldsDataProvider
Parameters
string | int$cronCommand‪Invalid cron command

Definition at line 324 of file NormalizeCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\splitFields().

◆ validMonthNamesDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::validMonthNamesDataProvider ( )
static
Returns
‪array

Definition at line 479 of file NormalizeCommandTest.php.

◆ validRangeDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::validRangeDataProvider ( )
static
Returns
‪array

Definition at line 334 of file NormalizeCommandTest.php.

◆ validSpecialKeywordsDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::validSpecialKeywordsDataProvider ( )
static
Returns
‪array

Definition at line 79 of file NormalizeCommandTest.php.

◆ validStepsDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::validStepsDataProvider ( )
static
Returns
‪array

Definition at line 393 of file NormalizeCommandTest.php.

◆ validWeekdayDataProvider()

static array TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::validWeekdayDataProvider ( )
static
Returns
‪array

Definition at line 571 of file NormalizeCommandTest.php.