‪TYPO3CMS  ‪main
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 ()
 
 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 normalizeValidDataProvider ()
 
static validSpecialKeywordsDataProvider ()
 
static normalizeFieldsValidDataProvider ()
 
static normalizeMonthAndWeekdayFieldValidDataProvider ()
 
static normalizeMonthAndWeekdayFieldInvalidDataProvider ()
 
static normalizeIntegerFieldValidDataProvider ()
 
static normalizeIntegerFieldInvalidDataProvider ()
 
static invalidCronCommandFieldsDataProvider ()
 
static validRangeDataProvider ()
 
static invalidRangeDataProvider ()
 
static validStepsDataProvider ()
 
static invalidStepsDataProvider ()
 
static validMonthNamesDataProvider ()
 
static invalidMonthNamesDataProvider ()
 
static validWeekdayDataProvider ()
 
static invalidWeekdayDataProvider ()
 

Detailed Description

Definition at line 26 of file NormalizeCommandTest.php.

Member Function Documentation

◆ convertKeywordsToCronCommandConvertsValidKeywords()

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

Definition at line 91 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 
)
Parameters
string | int$range‪Cron command range expression
string$expected‪Expected result (normalized range)

Definition at line 320 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 
)
Parameters
string$range‪Cron command range expression (invalid)
int$expectedExceptionCode‪Expected exception code from provider

Definition at line 348 of file NormalizeCommandTest.php.

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

◆ invalidCronCommandFieldsDataProvider()

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

Definition at line 279 of file NormalizeCommandTest.php.

◆ invalidMonthNamesDataProvider()

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

Definition at line 474 of file NormalizeCommandTest.php.

◆ invalidRangeDataProvider()

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

Definition at line 326 of file NormalizeCommandTest.php.

◆ invalidStepsDataProvider()

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

Definition at line 377 of file NormalizeCommandTest.php.

◆ invalidWeekdayDataProvider()

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

Definition at line 570 of file NormalizeCommandTest.php.

◆ normalizeConvertsCronCommand()

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

Definition at line 66 of file NormalizeCommandTest.php.

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

◆ normalizeFieldsConvertsField()

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

Definition at line 122 of file NormalizeCommandTest.php.

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

◆ normalizeFieldsValidDataProvider()

static TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeFieldsValidDataProvider ( )
static

Definition at line 105 of file NormalizeCommandTest.php.

◆ normalizeIntegerFieldInvalidDataProvider()

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

Definition at line 229 of file NormalizeCommandTest.php.

◆ normalizeIntegerFieldReturnsNormalizedListForValidExpression()

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

Definition at line 223 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 
)
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 253 of file NormalizeCommandTest.php.

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

◆ normalizeIntegerFieldValidDataProvider()

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

Definition at line 198 of file NormalizeCommandTest.php.

◆ normalizeMonthAndWeekdayFieldInvalidDataProvider()

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

Definition at line 169 of file NormalizeCommandTest.php.

◆ normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression ( string  $expression,
bool  $isMonthField,
string  $expected 
)
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 160 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 
)
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 188 of file NormalizeCommandTest.php.

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

◆ normalizeMonthAndWeekdayFieldValidDataProvider()

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

Definition at line 128 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 
)
Parameters
string | int$monthName‪Month name
int$expectedInteger‪Number of the month

Definition at line 457 of file NormalizeCommandTest.php.

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

◆ normalizeMonthReturnsInteger()

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

Definition at line 468 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 
)
Parameters
string | int$invalidMonthName‪Month name (invalid)
int$expectedExceptionCode‪Expected exception code

Definition at line 505 of file NormalizeCommandTest.php.

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

◆ normalizeValidDataProvider()

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

Definition at line 28 of file NormalizeCommandTest.php.

◆ normalizeWeekdayConvertsName()

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

Definition at line 553 of file NormalizeCommandTest.php.

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

◆ normalizeWeekdayReturnsInteger()

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

Definition at line 564 of file NormalizeCommandTest.php.

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

◆ normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation()

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

Definition at line 598 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 
)
Parameters
string$stepExpression‪Cron command step expression
string$expected‪Expected result (normalized range)

Definition at line 371 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 
)
Parameters
string$stepExpression‪Cron command step expression (invalid)
int$expectedExceptionCode‪Expected exception code

Definition at line 398 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)
Parameters
string | int$cronCommand‪Invalid cron command

Definition at line 295 of file NormalizeCommandTest.php.

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

◆ validMonthNamesDataProvider()

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

Definition at line 429 of file NormalizeCommandTest.php.

◆ validRangeDataProvider()

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

Definition at line 302 of file NormalizeCommandTest.php.

◆ validSpecialKeywordsDataProvider()

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

Definition at line 72 of file NormalizeCommandTest.php.

◆ validStepsDataProvider()

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

Definition at line 355 of file NormalizeCommandTest.php.

◆ validWeekdayDataProvider()

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

Definition at line 515 of file NormalizeCommandTest.php.