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

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 Attributes

 $timezoneBackup = ''
 

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 258 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 288 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 244 of file CronCommandTest.php.

calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime ( )
Test:

Definition at line 298 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 273 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 84 of file CronCommandTest.php.

constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds ( )
Test:

Definition at line 93 of file CronCommandTest.php.

constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds ( )
Test:

Definition at line 73 of file CronCommandTest.php.

constructorThrowsExceptionForInvalidCronCommand ( )
Test:

Definition at line 65 of file CronCommandTest.php.

static expectedCalculatedTimestampDataProvider ( )
static
Returns
array

Definition at line 183 of file CronCommandTest.php.

static expectedTimestampDataProvider ( )
static
Returns
array

Definition at line 102 of file CronCommandTest.php.

getCronCommandSectionsReturnsArray ( )
Test:

Definition at line 330 of file CronCommandTest.php.

getTimestampReturnsInteger ( )
Test:

Definition at line 321 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.