35 $this->testObject = $this->getMock(
'TYPO3\\CMS\\Scheduler\\Controller\\SchedulerModuleController', array(
'dummy'), array(),
'', FALSE);
49 '10 September 2000' => array(
58 '+1 week 2 days 4 hours 2 seconds' => array(
59 '+1 week 2 days 4 hours 2 seconds',
61 'next Thursday' => array(
64 'last Monday' => array(
78 $expectedTimestamp = strtotime($strToTimeValue);
79 $checkDateResult = $this->testObject->checkDate($strToTimeValue);
84 $this->assertLessThan($delta, $checkDateResult - $expectedTimestamp,
'assertLessThan fails with value "' . $strToTimeValue .
'"');
85 $this->assertInternalType(\PHPUnit_Framework_Constraint_IsType::TYPE_INT, $checkDateResult,
'assertType fails with value "' . $strToTimeValue .
'"');
96 '00:00 2011-05-30' => array(
98 mktime(0, 0, 0, 5, 30, 2011)
100 '00:01 2011-05-30' => array(
102 mktime(0, 1, 0, 5, 30, 2011)
104 '23:59 2011-05-30' => array(
106 mktime(23, 59, 0, 5, 30, 2011)
108 '15:35 2000-12-24' => array(
110 mktime(15, 35, 0, 12, 24, 2000)
112 '00:01 1970-01-01' => array(
114 mktime(0, 1, 0, 1, 1, 1970)
116 '17:26 2020-03-15' => array(
118 mktime(17, 26, 0, 3, 15, 2020)
120 '1:5 2020-03-15' => array(
122 mktime(1, 5, 0, 3, 15, 2020)
124 '10:50 2020-3-5' => array(
126 mktime(10, 50, 0, 3, 5, 2020)
128 '01:01 1968-01-01' => array(
130 mktime(1, 1, 0, 1, 1, 1968)
142 $this->assertSame($expectedTimestamp, $this->testObject->checkDate($typo3DateValue),
'Fails with value "' . $typo3DateValue .
'"');
156 'HH:ii yyyy-mm-dd' => array(
171 $this->testObject->checkDate($dateValue);
checkDateWithInvalidDateValues($dateValue)
checkDateWithStrtotimeValuesDataProvider()
checkDateWithTypo3DateSyntaxDataProvider()
checkDateWithTypo3DateSyntax($typo3DateValue, $expectedTimestamp)
checkDateWithInvalidDateValuesDataProvider()
checkDateWithStrtotimeValues($strToTimeValue)