TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
NormalizeCommandTest Class Reference
Inheritance diagram for NormalizeCommandTest:
UnitTestCase BaseTestCase

Public Member Functions

 normalizeConvertsCronCommand ($expression, $expected)
 
 convertKeywordsToCronCommandConvertsValidKeywords ($keyword, $expectedCronCommand)
 
 convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound ()
 
 normalizeFieldsValidDataProvider ()
 
 normalizeFieldsConvertsField ($expression, $expected)
 
 normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression ($expression, $isMonthField, $expected)
 
 normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression ($expression, $isMonthField, $expectedExceptionCode)
 
 normalizeIntegerFieldReturnsNormalizedListForValidExpression ($expression, $expected)
 
 normalizeIntegerFieldThrowsExceptionForInvalidExpressions ($expression, $lowerBound, $upperBound, $expectedExceptionCode)
 
 splitFieldsReturnsIntegerArrayWithFieldsSplitByWhitespace ()
 
 splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields ($cronCommand)
 
 convertRangeToListOfValuesReturnsCorrectListForValidRanges ($range, $expected)
 
 convertRangeToListOfValuesThrowsExceptionForInvalidRanges ($range, $expectedExceptionCode)
 
 reduceListOfValuesByStepValueReturnsCorrectListOfValues ($stepExpression, $expected)
 
 reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions ($stepExpression, $expectedExceptionCode)
 
 normalizeMonthAndWeekdayNormalizesAMonth ()
 
 normalizeMonthAndWeekdayNormalizesAWeekday ()
 
 normalizeMonthAndWeekdayLeavesValueUnchanged ()
 
 normalizeMonthConvertsName ($monthName, $expectedInteger)
 
 normalizeMonthReturnsInteger ($monthName, $expectedInteger)
 
 normalizeMonthThrowsExceptionForInvalidMonthRepresentation ($invalidMonthName, $expectedExceptionCode)
 
 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 ()
 

Additional Inherited Members

- Protected Member Functions inherited from UnitTestCase
 tearDown ()
 
- Protected Member Functions inherited from BaseTestCase
 getAccessibleMock ($originalClassName, $methods=[], array $arguments=[], $mockClassName= '', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true)
 
 getAccessibleMockForAbstractClass ($originalClassName, array $arguments=[], $mockClassName= '', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true, $mockedMethods=[])
 
 buildAccessibleProxy ($className)
 
 callInaccessibleMethod ($object, $name,...$arguments)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix= '')
 
- Protected Attributes inherited from UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

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 92 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 346 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\convertRangeToListOfValues().

convertRangeToListOfValuesThrowsExceptionForInvalidRanges (   $range,
  $expectedExceptionCode 
)
Test:
invalidRangeDataProvider
Parameters
string$rangeCron command range expression (invalid)
int$expectedExceptionCodeExpected exception code from provider

Definition at line 377 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\convertRangeToListOfValues().

static invalidCronCommandFieldsDataProvider ( )
static
Returns
array

Definition at line 302 of file NormalizeCommandTest.php.

static invalidMonthNamesDataProvider ( )
static
Returns
array

Definition at line 522 of file NormalizeCommandTest.php.

static invalidRangeDataProvider ( )
static
Returns
array

Definition at line 355 of file NormalizeCommandTest.php.

static invalidStepsDataProvider ( )
static
Returns
array

Definition at line 412 of file NormalizeCommandTest.php.

static invalidWeekdayDataProvider ( )
static
Returns
array

Definition at line 625 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 64 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 128 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeFields().

normalizeFieldsValidDataProvider ( )
Returns
array

Definition at line 111 of file NormalizeCommandTest.php.

static normalizeIntegerFieldInvalidDataProvider ( )
static
Returns
array

Definition at line 247 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 238 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeIntegerField().

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

Definition at line 271 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeIntegerField().

static normalizeIntegerFieldValidDataProvider ( )
static
Returns
array

Definition at line 213 of file NormalizeCommandTest.php.

static normalizeMonthAndWeekdayFieldInvalidDataProvider ( )
static
Returns
array

Definition at line 181 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 169 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

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

Definition at line 200 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

static normalizeMonthAndWeekdayFieldValidDataProvider ( )
static
Returns
array

Definition at line 137 of file NormalizeCommandTest.php.

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

Definition at line 501 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 513 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeMonth().

normalizeMonthThrowsExceptionForInvalidMonthRepresentation (   $invalidMonthName,
  $expectedExceptionCode 
)
Test:
invalidMonthNamesDataProvider
Parameters
string$invalidMonthNameMonth name (invalid)
int$expectedExceptionCodeExpected exception code

Definition at line 553 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 604 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 616 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\normalizeWeekday().

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

Definition at line 653 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 403 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue().

reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions (   $stepExpression,
  $expectedExceptionCode 
)
Test:
invalidStepsDataProvider
Parameters
string$stepExpressionCron command step expression (invalid)
int$expectedExceptionCodeExpected exception code

Definition at line 433 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue().

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

Definition at line 318 of file NormalizeCommandTest.php.

References NormalizeCommandAccessibleProxy\splitFields().

static validMonthNamesDataProvider ( )
static
Returns
array

Definition at line 473 of file NormalizeCommandTest.php.

static validRangeDataProvider ( )
static
Returns
array

Definition at line 328 of file NormalizeCommandTest.php.

static validSpecialKeywordsDataProvider ( )
static
Returns
array

Definition at line 73 of file NormalizeCommandTest.php.

static validStepsDataProvider ( )
static
Returns
array

Definition at line 387 of file NormalizeCommandTest.php.

static validWeekdayDataProvider ( )
static
Returns
array

Definition at line 566 of file NormalizeCommandTest.php.