‪TYPO3CMS  11.5
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 array expectedTimestampDataProvider ()
 
static array expectedCalculatedTimestampDataProvider ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Protected Attributes

string $timezoneBackup = ''
 

Private Attributes

const TIMESTAMP = 1262304000
 

Detailed Description

Test case

Definition at line 26 of file CronCommandTest.php.

Member Function Documentation

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestamp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestamp ( string  $cronCommand,
int  $startTimestamp,
string  $expectedTimestamp 
)
Test:
‪@dataProvider expectedCalculatedTimestampDataProvider
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 264 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall ( string  $cronCommand,
int  $startTimestamp,
string  $firstTimestamp,
string  $secondTimestamp 
)
Test:
‪@dataProvider expectedCalculatedTimestampDataProvider
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 294 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestamp()

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

Definition at line 250 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime()

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

Definition at line 304 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall ( string  $cronCommand,
int  $startTimestamp,
int  $firstTimestamp,
int  $secondTimestamp 
)
Test:
‪@dataProvider expectedTimestampDataProvider
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 279 of file CronCommandTest.php.

◆ calculateNextValueThrowsExceptionWithImpossibleCronCommand()

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

Definition at line 317 of file CronCommandTest.php.

◆ constructorSetsNormalizedCronCommandSections()

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

Definition at line 60 of file CronCommandTest.php.

◆ constructorSetsTimestampToGivenTimestampPlusSixtySeconds()

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

Definition at line 90 of file CronCommandTest.php.

◆ constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds()

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

Definition at line 99 of file CronCommandTest.php.

◆ constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds()

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

Definition at line 79 of file CronCommandTest.php.

◆ constructorThrowsExceptionForInvalidCronCommand()

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

Definition at line 69 of file CronCommandTest.php.

◆ expectedCalculatedTimestampDataProvider()

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

Definition at line 189 of file CronCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest\TIMESTAMP.

◆ expectedTimestampDataProvider()

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

Definition at line 108 of file CronCommandTest.php.

References TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest\TIMESTAMP.

◆ getCronCommandSectionsReturnsArray()

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

Definition at line 337 of file CronCommandTest.php.

◆ getTimestampReturnsInteger()

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

Definition at line 328 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 44 of file CronCommandTest.php.

◆ tearDown()

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

Definition at line 51 of file CronCommandTest.php.

Member Data Documentation

◆ $timezoneBackup

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

Definition at line 36 of file CronCommandTest.php.

◆ TIMESTAMP

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