‪TYPO3CMS  ‪main
TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest Class Reference
Inheritance diagram for TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest:

Public Member Functions

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

Static Public Member Functions

static expectedTimestampDataProvider ()
 
static expectedCalculatedTimestampDataProvider ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Protected Attributes

string $timezoneBackup = ''
 

Private Attributes

const TIMESTAMP = 1262304000
 

Detailed Description

Definition at line 25 of file CronCommandTest.php.

Member Function Documentation

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestamp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestamp ( string  $cronCommand,
int  $startTimestamp,
string  $expectedTimestamp 
)
Parameters
string$cronCommand‪Cron command
int$startTimestamp‪Timestamp for start of calculation
string$expectedTimestamp‪Expected result (next time of execution), to be fed to strtotime

Definition at line 247 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall ( string  $cronCommand,
int  $startTimestamp,
string  $firstTimestamp,
string  $secondTimestamp 
)
Parameters
string$cronCommand‪Cron command
int$startTimestamp‪[unused] Timestamp for start of calculation
string$firstTimestamp‪Timestamp of the next execution, to be fed to strtotime
string$secondTimestamp‪Timestamp of the further execution, to be fed to strtotime

Definition at line 277 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestamp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestamp ( string  $cronCommand,
int  $startTimestamp,
int  $expectedTimestamp 
)
Parameters
string$cronCommand‪Cron command
int$startTimestamp‪Timestamp for start of calculation
int$expectedTimestamp‪Expected result (next time of execution)

Definition at line 233 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime ( )

Definition at line 285 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall ( string  $cronCommand,
int  $startTimestamp,
int  $firstTimestamp,
int  $secondTimestamp 
)
Parameters
string$cronCommand‪Cron command
int$startTimestamp‪[unused] Timestamp for start of calculation
int$firstTimestamp‪Timestamp of the next execution
int$secondTimestamp‪Timestamp of the further execution

Definition at line 262 of file CronCommandTest.php.

◆ calculateNextValueThrowsExceptionWithImpossibleCronCommand()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueThrowsExceptionWithImpossibleCronCommand ( )

Definition at line 296 of file CronCommandTest.php.

◆ constructorSetsNormalizedCronCommandSections()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::constructorSetsNormalizedCronCommandSections ( )

Definition at line 57 of file CronCommandTest.php.

◆ constructorSetsTimestampToGivenTimestampPlusSixtySeconds()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::constructorSetsTimestampToGivenTimestampPlusSixtySeconds ( )

Definition at line 81 of file CronCommandTest.php.

◆ constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds ( )

Definition at line 88 of file CronCommandTest.php.

◆ constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds ( )

Definition at line 72 of file CronCommandTest.php.

◆ constructorThrowsExceptionForInvalidCronCommand()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::constructorThrowsExceptionForInvalidCronCommand ( )

Definition at line 64 of file CronCommandTest.php.

◆ expectedCalculatedTimestampDataProvider()

static TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::expectedCalculatedTimestampDataProvider ( )
static

◆ expectedTimestampDataProvider()

static TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::expectedTimestampDataProvider ( )
static

◆ getCronCommandSectionsReturnsArray()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::getCronCommandSectionsReturnsArray ( )

Definition at line 312 of file CronCommandTest.php.

◆ getTimestampReturnsInteger()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::getTimestampReturnsInteger ( )

Definition at line 305 of file CronCommandTest.php.

◆ setUp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::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 43 of file CronCommandTest.php.

◆ tearDown()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::tearDown ( )
protected

Definition at line 50 of file CronCommandTest.php.

Member Data Documentation

◆ $timezoneBackup

string TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::$timezoneBackup = ''
protected

Definition at line 35 of file CronCommandTest.php.

◆ TIMESTAMP

const TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::TIMESTAMP = 1262304000
private