TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest Class Reference
Inheritance diagram for TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest:
TYPO3\CMS\Core\Tests\UnitTestCase TYPO3\CMS\Core\Tests\BaseTestCase

Public Member Functions

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

 $timezoneBackup = ''
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 $backupGlobalsBlacklist = array('TYPO3_LOADED_EXT')
 
- Protected Attributes inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 $backupGlobals = TRUE
 
 $backupStaticAttributes = FALSE
 

Additional Inherited Members

- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\UnitTestCase
 tearDown ()
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Tests\BaseTestCase
 getAccessibleMock ( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
 
 getAccessibleMockForAbstractClass ( $originalClassName, array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
 
 buildAccessibleProxy ($className)
 
 callInaccessibleMethod ($object, $name)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix='')
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Test case

Author
Christian Kuhn lolli.nosp@m.@sch.nosp@m.warzb.nosp@m.u.ch

Definition at line 21 of file CronCommandTest.php.

Member Function Documentation

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestamp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestamp (   $cronCommand,
  $startTimestamp,
  $expectedTimestamp 
)
Test:
expectedCalculatedTimestampDataProvider
Parameters
string$cronCommandCron command
integer$startTimestampTimestamp for start of calculation
string$expectedTimestampExpected result (next time of execution), to be feeded to strtotime

Definition at line 247 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextCalculatedTimestampOnConsecutiveCall (   $cronCommand,
  $startTimestamp,
  $firstTimestamp,
  $secondTimestamp 
)
Test:
expectedCalculatedTimestampDataProvider
Parameters
string$cronCommandCron command
integer$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 275 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestamp()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestamp (   $cronCommand,
  $startTimestamp,
  $expectedTimestamp 
)
Test:
expectedTimestampDataProvider
Parameters
string$cronCommandCron command
integer$startTimestampTimestamp for start of calculation
integer$expectedTimestampExpected result (next time of execution)

Definition at line 234 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnChangeToSummertime()

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

Definition at line 284 of file CronCommandTest.php.

◆ calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall()

TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\CronCommandTest::calculateNextValueDeterminesCorrectNextTimestampOnConsecutiveCall (   $cronCommand,
  $startTimestamp,
  $firstTimestamp,
  $secondTimestamp 
)
Test:
expectedTimestampDataProvider
Parameters
string$cronCommandCron command
integer$startTimestamp[unused] Timestamp for start of calculation
integer$firstTimestampTimestamp of the next execution
integer$secondTimestampTimestamp of the further execution

Definition at line 261 of file CronCommandTest.php.

◆ calculateNextValueThrowsExceptionWithImpossibleCronCommand()

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

Definition at line 297 of file CronCommandTest.php.

◆ constructorSetsNormalizedCronCommandSections()

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

Definition at line 52 of file CronCommandTest.php.

◆ constructorSetsTimestampToGivenTimestampPlusSixtySeconds()

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

Definition at line 78 of file CronCommandTest.php.

◆ constructorSetsTimestampToGiveTimestampRoundedDownToSixtySeconds()

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

Definition at line 86 of file CronCommandTest.php.

◆ constructorSetsTimestampToNowPlusOneMinuteRoundedDownToSixtySeconds()

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

Definition at line 68 of file CronCommandTest.php.

◆ constructorThrowsExceptionForInvalidCronCommand()

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

Definition at line 61 of file CronCommandTest.php.

◆ expectedCalculatedTimestampDataProvider()

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

Definition at line 174 of file CronCommandTest.php.

◆ expectedTimestampDataProvider()

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

Definition at line 94 of file CronCommandTest.php.

◆ getCronCommandSectionsReturnsArray()

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

Definition at line 313 of file CronCommandTest.php.

◆ getTimestampReturnsInteger()

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

Definition at line 305 of file CronCommandTest.php.

◆ setUp()

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

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 39 of file CronCommandTest.php.

◆ tearDown()

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

Definition at line 44 of file CronCommandTest.php.

Member Data Documentation

◆ $timezoneBackup

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

Definition at line 31 of file CronCommandTest.php.

◆ TIMESTAMP

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

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

Definition at line 26 of file CronCommandTest.php.