TYPO3  7.6
Public Member Functions | Static Public Member Functions | List of all members
NormalizeCommandTest Class Reference
Inheritance diagram for NormalizeCommandTest:

Public Member Functions

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

Static Public Member Functions

static normalizeValidDataProvider ()
 
static validSpecialKeywordsDataProvider ()
 
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

Test case

Definition at line 24 of file NormalizeCommandTest.php.

Member Function Documentation

convertKeywordsToCronCommandConvertsValidKeywords (   $keyword,
  $expectedCronCommand 
)
Test:
validSpecialKeywordsDataProvider
Parameters
string$keywordCron command keyword
string$expectedCronCommandExpected result (normalized cron command syntax)

Definition at line 89 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\convertKeywordsToCronCommand().

convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound ( )
convertRangeToListOfValuesReturnsCorrectListForValidRanges (   $range,
  $expected 
)
Test:
validRangeDataProvider
Parameters
string$rangeCron command range expression
string$expectedExpected result (normalized range)

Definition at line 327 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\convertRangeToListOfValues().

convertRangeToListOfValuesThrowsExceptionForInvalidRanges (   $range)
Test:
invalidRangeDataProvider
Parameters
string$rangeCron command range expression (invalid)

Definition at line 358 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\convertRangeToListOfValues().

static invalidCronCommandFieldsDataProvider ( )
static
Returns
array

Definition at line 284 of file NormalizeCommandTest.php.

static invalidMonthNamesDataProvider ( )
static
Returns
array

Definition at line 496 of file NormalizeCommandTest.php.

static invalidRangeDataProvider ( )
static
Returns
array

Definition at line 336 of file NormalizeCommandTest.php.

static invalidStepsDataProvider ( )
static
Returns
array

Definition at line 391 of file NormalizeCommandTest.php.

static invalidWeekdayDataProvider ( )
static
Returns
array

Definition at line 594 of file NormalizeCommandTest.php.

normalizeConvertsCronCommand (   $expression,
  $expected 
)
Test:
normalizeValidDataProvider
Parameters
string$expressionCron command to test
string$expectedExpected result (normalized cron command syntax)

Definition at line 61 of file NormalizeCommandTest.php.

References NormalizeCommand\normalize().

normalizeFieldsConvertsField (   $expression,
  $expected 
)
Test:
normalizeFieldsValidDataProvider
Parameters
string$expressionCron command to normalize
string$expectedExpected result (normalized cron command syntax)

Definition at line 125 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeFields().

normalizeFieldsValidDataProvider ( )
Returns
array

Definition at line 108 of file NormalizeCommandTest.php.

static normalizeIntegerFieldInvalidDataProvider ( )
static
Returns
array

Definition at line 236 of file NormalizeCommandTest.php.

normalizeIntegerFieldReturnsNormalizedListForValidExpression (   $expression,
  $expected 
)
Test:
normalizeIntegerFieldValidDataProvider
Parameters
string$expressionCron command partial integer expression
string$expectedExpected result (normalized integer or integer list)

Definition at line 227 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeIntegerField().

normalizeIntegerFieldThrowsExceptionForInvalidExpressions (   $expression,
  $lowerBound,
  $upperBound 
)
Test:
normalizeIntegerFieldInvalidDataProvider
Parameters
string$expressionCron command partial integer expression (invalid)
int$lowerBoundLower limit
int$upperBoundUpper limit

Definition at line 260 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeIntegerField().

static normalizeIntegerFieldValidDataProvider ( )
static
Returns
array

Definition at line 202 of file NormalizeCommandTest.php.

static normalizeMonthAndWeekdayFieldInvalidDataProvider ( )
static
Returns
array

Definition at line 175 of file NormalizeCommandTest.php.

normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression (   $expression,
  $isMonthField,
  $expected 
)
Test:
normalizeMonthAndWeekdayFieldValidDataProvider
Parameters
string$expressionCron command partial expression for month and weekday fields
bool$isMonthFieldFlag to designate month field or not
string$expectedExpected result (normalized months or weekdays)

Definition at line 166 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression (   $expression,
  $isMonthField 
)
Test:
normalizeMonthAndWeekdayFieldInvalidDataProvider
Parameters
string$expressionCron command partial expression for month and weekday fields (invalid)
bool$isMonthFieldFlag to designate month field or not

Definition at line 194 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

static normalizeMonthAndWeekdayFieldValidDataProvider ( )
static
Returns
array

Definition at line 134 of file NormalizeCommandTest.php.

normalizeMonthAndWeekdayLeavesValueUnchanged ( )
normalizeMonthAndWeekdayNormalizesAMonth ( )
normalizeMonthAndWeekdayNormalizesAWeekday ( )
normalizeMonthConvertsName (   $monthName,
  $expectedInteger 
)
Test:
validMonthNamesDataProvider
Parameters
string$monthNameMonth name
int$expectedIntegerNumber of the month

Definition at line 475 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonth().

normalizeMonthReturnsInteger (   $monthName,
  $expectedInteger 
)
Test:
validMonthNamesDataProvider
Parameters
string$monthNameMonth name
int$expectedIntegerNumber of the month (not used)

Definition at line 487 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonth().

normalizeMonthThrowsExceptionForInvalidMonthRepresentation (   $invalidMonthName)
Test:
invalidMonthNamesDataProvider
Parameters
string$invalidMonthNameMonth name (invalid)

Definition at line 527 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonth().

static normalizeValidDataProvider ( )
static
Returns
array

Definition at line 29 of file NormalizeCommandTest.php.

normalizeWeekdayConvertsName (   $weekday,
  $expectedInteger 
)
Test:
validWeekdayDataProvider
Parameters
string$weekdayWeekday expression
int$expectedIntegerNumber of weekday

Definition at line 573 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeWeekday().

normalizeWeekdayReturnsInteger (   $weekday,
  $expectedInteger 
)
Test:
validWeekdayDataProvider
Parameters
string$weekdayWeekday expression
int$expectedIntegerNumber of weekday (not used)

Definition at line 585 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeWeekday().

normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation (   $weekday)
Test:
invalidWeekdayDataProvider
Parameters
string$weekdayWeekday expression (invalid)

Definition at line 623 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeWeekday().

reduceListOfValuesByStepValueReturnsCorrectListOfValues (   $stepExpression,
  $expected 
)
Test:
validStepsDataProvider
Parameters
string$stepExpressionCron command step expression
string$expectedExpected result (normalized range)

Definition at line 382 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue().

reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions (   $stepExpression)
Test:
invalidStepsDataProvider
Parameters
string$stepExpressionCron command step expression (invalid)

Definition at line 412 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue().

splitFieldsReturnsIntegerArrayWithFieldsSplitByWhitespace ( )
splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields (   $cronCommand)
Test:
invalidCronCommandFieldsDataProvider
Parameters
string$cronCommandInvalid cron command

Definition at line 301 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\splitFields().

static validMonthNamesDataProvider ( )
static
Returns
array

Definition at line 447 of file NormalizeCommandTest.php.

static validRangeDataProvider ( )
static
Returns
array

Definition at line 309 of file NormalizeCommandTest.php.

static validSpecialKeywordsDataProvider ( )
static
Returns
array

Definition at line 70 of file NormalizeCommandTest.php.

static validStepsDataProvider ( )
static
Returns
array

Definition at line 366 of file NormalizeCommandTest.php.

static validWeekdayDataProvider ( )
static
Returns
array

Definition at line 535 of file NormalizeCommandTest.php.