TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest Class Reference
Inheritance diagram for TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest:
TYPO3\CMS\Core\Tests\UnitTestCase TYPO3\CMS\Core\Tests\BaseTestCase

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 ()
 

Additional Inherited Members

- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 tearDown ()
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\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)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix='')
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Detailed Description

Test case

Definition at line 24 of file NormalizeCommandTest.php.

Member Function Documentation

◆ convertKeywordsToCronCommandConvertsValidKeywords()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 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,
  $expected 
)
Test:
validRangeDataProvider
Parameters
string$rangeCron command range expression
string$expectedExpected result (normalized range)

Definition at line 327 of file NormalizeCommandTest.php.

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

◆ convertRangeToListOfValuesThrowsExceptionForInvalidRanges()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::convertRangeToListOfValuesThrowsExceptionForInvalidRanges (   $range)
Test:
invalidRangeDataProvider
Parameters
string$rangeCron command range expression (invalid)

Definition at line 358 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
Returns
array

Definition at line 284 of file NormalizeCommandTest.php.

◆ invalidMonthNamesDataProvider()

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

Definition at line 496 of file NormalizeCommandTest.php.

◆ invalidRangeDataProvider()

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

Definition at line 336 of file NormalizeCommandTest.php.

◆ invalidStepsDataProvider()

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

Definition at line 391 of file NormalizeCommandTest.php.

◆ invalidWeekdayDataProvider()

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

Definition at line 594 of file NormalizeCommandTest.php.

◆ normalizeConvertsCronCommand()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\CronCommand\NormalizeCommand\normalize().

◆ normalizeFieldsConvertsField()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeFields().

◆ normalizeFieldsValidDataProvider()

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

Definition at line 108 of file NormalizeCommandTest.php.

◆ normalizeIntegerFieldInvalidDataProvider()

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

Definition at line 236 of file NormalizeCommandTest.php.

◆ normalizeIntegerFieldReturnsNormalizedListForValidExpression()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeIntegerField().

◆ normalizeIntegerFieldThrowsExceptionForInvalidExpressions()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeIntegerField().

◆ normalizeIntegerFieldValidDataProvider()

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

Definition at line 202 of file NormalizeCommandTest.php.

◆ normalizeMonthAndWeekdayFieldInvalidDataProvider()

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

Definition at line 175 of file NormalizeCommandTest.php.

◆ normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

◆ normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField().

◆ normalizeMonthAndWeekdayFieldValidDataProvider()

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

Definition at line 134 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,
  $expectedInteger 
)
Test:
validMonthNamesDataProvider
Parameters
string$monthNameMonth name
int$expectedIntegerNumber of the month

Definition at line 475 of file NormalizeCommandTest.php.

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

◆ normalizeMonthReturnsInteger()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonth().

◆ normalizeMonthThrowsExceptionForInvalidMonthRepresentation()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeMonthThrowsExceptionForInvalidMonthRepresentation (   $invalidMonthName)
Test:
invalidMonthNamesDataProvider
Parameters
string$invalidMonthNameMonth name (invalid)

Definition at line 527 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
Returns
array

Definition at line 29 of file NormalizeCommandTest.php.

◆ normalizeWeekdayConvertsName()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeWeekdayConvertsName (   $weekday,
  $expectedInteger 
)
Test:
validWeekdayDataProvider
Parameters
string$weekdayWeekday expression
int$expectedIntegerNumber of weekday

Definition at line 573 of file NormalizeCommandTest.php.

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

◆ normalizeWeekdayReturnsInteger()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::normalizeWeekdayReturnsInteger (   $weekday,
  $expectedInteger 
)
Test:
validWeekdayDataProvider
Parameters
string$weekdayWeekday expression
int$expectedIntegerNumber of weekday (not used)

Definition at line 585 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:
invalidWeekdayDataProvider
Parameters
string$weekdayWeekday expression (invalid)

Definition at line 623 of file NormalizeCommandTest.php.

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

◆ reduceListOfValuesByStepValueReturnsCorrectListOfValues()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::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 TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue().

◆ reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest::reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions (   $stepExpression)
Test:
invalidStepsDataProvider
Parameters
string$stepExpressionCron command step expression (invalid)

Definition at line 412 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:
invalidCronCommandFieldsDataProvider
Parameters
string$cronCommandInvalid cron command

Definition at line 301 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
Returns
array

Definition at line 447 of file NormalizeCommandTest.php.

◆ validRangeDataProvider()

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

Definition at line 309 of file NormalizeCommandTest.php.

◆ validSpecialKeywordsDataProvider()

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

Definition at line 70 of file NormalizeCommandTest.php.

◆ validStepsDataProvider()

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

Definition at line 366 of file NormalizeCommandTest.php.

◆ validWeekdayDataProvider()

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

Definition at line 535 of file NormalizeCommandTest.php.