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

Public Member Functions

 constructorSetsNormalizedCronCommandSections ()
 
 constructorThrowsExceptionForInvalidCronCommand ()
 
 constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds ()
 
 constructorSetsTimestampToGivenTimestampPlusSixtySeconds ()
 
 constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds ()
 
 calculateNextValueDeterminesCorrectNextTimestamp ($cronCommand, $startTimestamp, $expectedTimestamp)
 
 calculateNextValueDeterminesCorrectNextCalculatedTimestamp ($cronCommand, $startTimestamp, $expectedTimestamp)
 
 calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall ($cronCommand, $startTimestamp, $firstTimestamp, $secondTimestamp)
 
 calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall ($cronCommand, $startTimestamp, $firstTimestamp, $secondTimestamp)
 
 calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime ()
 
 calculateNextValueThrowsExceptionWithImpossibleCronCommand ()
 
 getTimestampReturnsInteger ()
 
 getCronCommandSectionsReturnsArray ()
 

Static Public Member Functions

static expectedTimestampDataProvider ()
 
static expectedCalculatedTimestampDataProvider ()
 

Public Attributes

const TIMESTAMP = 1262304000
 

Protected Member Functions

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

 $timezoneBackup = ''
 
- 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 22 of file CronCommandTest.php.

Member Function Documentation

calculateNextValueDeterminesCorrectNextCalculatedTimestamp (   $cronCommand,
  $startTimestamp,
  $expectedTimestamp 
)
Test:
expectedCalculatedTimestampDataProvider
Parameters
string$cronCommandCron command
int$startTimestampTimestamp for start of calculation
string$expectedTimestampExpected result (next time of execution), to be feeded to strtotime

Definition at line 259 of file CronCommandTest.php.

calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall (   $cronCommand,
  $startTimestamp,
  $firstTimestamp,
  $secondTimestamp 
)
Test:
expectedCalculatedTimestampDataProvider
Parameters
string$cronCommandCron command
int$startTimestamp[unused] Timestamp for start of calculation
string$firstTimestampTimestamp of the next execution, to be fed to strtotime
string$secondTimestampTimestamp of the further execution, to be fed to strtotime

Definition at line 289 of file CronCommandTest.php.

calculateNextValueDeterminesCorrectNextTimestamp (   $cronCommand,
  $startTimestamp,
  $expectedTimestamp 
)
Test:
expectedTimestampDataProvider
Parameters
string$cronCommandCron command
int$startTimestampTimestamp for start of calculation
int$expectedTimestampExpected result (next time of execution)

Definition at line 245 of file CronCommandTest.php.

calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime ( )
Test:

Definition at line 299 of file CronCommandTest.php.

calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall (   $cronCommand,
  $startTimestamp,
  $firstTimestamp,
  $secondTimestamp 
)
Test:
expectedTimestampDataProvider
Parameters
string$cronCommandCron command
int$startTimestamp[unused] Timestamp for start of calculation
int$firstTimestampTimestamp of the next execution
int$secondTimestampTimestamp of the further execution

Definition at line 274 of file CronCommandTest.php.

calculateNextValueThrowsExceptionWithImpossibleCronCommand ( )
Test:

Definition at line 312 of file CronCommandTest.php.

constructorSetsNormalizedCronCommandSections ( )
Test:

Definition at line 55 of file CronCommandTest.php.

constructorSetsTimestampToGivenTimestampPlusSixtySeconds ( )
Test:

Definition at line 85 of file CronCommandTest.php.

constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds ( )
Test:

Definition at line 94 of file CronCommandTest.php.

constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds ( )
Test:

Definition at line 74 of file CronCommandTest.php.

constructorThrowsExceptionForInvalidCronCommand ( )
Test:

Definition at line 64 of file CronCommandTest.php.

static expectedCalculatedTimestampDataProvider ( )
static
Returns
array

Definition at line 184 of file CronCommandTest.php.

static expectedTimestampDataProvider ( )
static
Returns
array

Definition at line 103 of file CronCommandTest.php.

getCronCommandSectionsReturnsArray ( )
Test:

Definition at line 332 of file CronCommandTest.php.

getTimestampReturnsInteger ( )
Test:

Definition at line 323 of file CronCommandTest.php.

setUp ( )
protected

We're fiddling with hard timestamps in the tests, but time methods in the system under test do use timezone settings. Therefore we backup the current timezone setting, set it to UTC explicitly and reconstitute it again in tearDown()

Definition at line 40 of file CronCommandTest.php.

tearDown ( )
protected

Definition at line 46 of file CronCommandTest.php.

Member Data Documentation

$timezoneBackup = ''
protected

Definition at line 32 of file CronCommandTest.php.

const TIMESTAMP = 1262304000

integer timestamp of 1.1.2010 0:00 (Friday), timezone UTC/GMT

Definition at line 27 of file CronCommandTest.php.