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

Public Attributes

const TIMESTAMP = 1262304000
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Protected Attributes

string $timezoneBackup = ''
 

Detailed Description

Test case

Definition at line 23 of file CronCommandTest.php.

Member Function Documentation

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestamp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestamp (   $cronCommand,
  $startTimestamp,
  $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 feeded to strtotime

Definition at line 259 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall (   $cronCommand,
  $startTimestamp,
  $firstTimestamp,
  $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 289 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestamp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestamp (   $cronCommand,
  $startTimestamp,
  $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 245 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime()

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

Definition at line 299 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall (   $cronCommand,
  $startTimestamp,
  $firstTimestamp,
  $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 274 of file CronCommandTest.php.

◆ calculateNextValueThrowsExceptionWithImpossibleCronCommand()

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

Definition at line 312 of file CronCommandTest.php.

◆ constructorSetsNormalizedCronCommandSections()

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

Definition at line 55 of file CronCommandTest.php.

◆ constructorSetsTimestampToGivenTimestampPlusSixtySeconds()

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

Definition at line 85 of file CronCommandTest.php.

◆ constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds()

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

Definition at line 94 of file CronCommandTest.php.

◆ constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds()

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

Definition at line 74 of file CronCommandTest.php.

◆ constructorThrowsExceptionForInvalidCronCommand()

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

Definition at line 64 of file CronCommandTest.php.

◆ expectedCalculatedTimestampDataProvider()

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

Definition at line 184 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 103 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 332 of file CronCommandTest.php.

◆ getTimestampReturnsInteger()

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

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

◆ tearDown()

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

Definition at line 46 of file CronCommandTest.php.

Member Data Documentation

◆ $timezoneBackup

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

Selected timezone backup

Definition at line 32 of file CronCommandTest.php.

◆ TIMESTAMP

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