Skip to content
Snippets Groups Projects
Commit f57fc537 authored by Jürgen Haas's avatar Jürgen Haas
Browse files

Code style fixes

parent 175091d2
No related branches found
Tags 1.0.0-rc1
No related merge requests found
......@@ -89,13 +89,7 @@ class CronEvent extends Event implements ConditionalApplianceInterface {
$lastRun -= ($lastRun % 60);
try {
$nextRun = $this->getNextRunTimestamp($lastRun, $frequency);
// The next few lines are hewlpful for debugging.
// $tz = new \DateTimeZone('UTC');
// $debugCurrent = (new \DateTime('now', $tz))->setTimestamp($currentTime)->format('Y-m-d H-i');
// $debugLast = (new \DateTime('now', $tz))->setTimestamp($lastRun)->format('Y-m-d H-i');
// $debugNext = (new \DateTime('now', $tz))->setTimestamp($nextRun)->format('Y-m-d H-i');
return $currentTime >= $nextRun;
return $currentTime >= $this->getNextRunTimestamp($lastRun, $frequency);
}
catch (\Exception $e) {
// @todo Log this exception.
......
......@@ -150,21 +150,47 @@ class CronEventTest extends UnitTestCase {
['30 0 * * ' . $weekday_today, FALSE, FALSE, FALSE, 'Today at 00:30 AM.'],
['0 1 * * ' . $weekday_today, FALSE, FALSE, FALSE, 'Today at 01:00 AM.'],
['30 1 * * ' . $weekday_today, TRUE, FALSE, FALSE, 'Today at 01:30 AM.'],
['0,1,2,3,4,5 1 * * ' . $weekday_today, TRUE, FALSE, FALSE, 'Today at 01:00-05 AM.'],
['0,1,2,3,4,5 1 * * ' . $weekday_today, TRUE, FALSE, FALSE,
'Today at 01:00-05 AM.',
],
['0 2 * * ' . $weekday_today, TRUE, FALSE, FALSE, 'Today at 02:00 AM.'],
['0 3 * * ' . $weekday_today, FALSE, FALSE, FALSE, 'Today at 03:00 AM.'],
['* * * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE, 'Every minute tomorrow.'],
['0 0 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE, 'Tomorrow at 00:00 AM.'],
['0 1 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE, 'Tomorrow at 01:00 AM.'],
['0 2 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE, 'Tomorrow at 02:00 AM.'],
['0 3 * * ' . $weekday_tomorrow, FALSE, FALSE, FALSE, 'Tomorrow at 03:00 AM.'],
['0,1,2,3,4,5 1 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE, 'Tomorrow at 01:00-05 AM.'],
['* * * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE, 'Every minute after tomorrow.'],
['0 0 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE, 'After tomorrow at 00:00 AM.'],
['0 1 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE, 'After tomorrow at 01:00 AM.'],
['0 2 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE, 'After tomorrow at 02:00 AM.'],
['0 3 * * ' . $weekday_after_tomorrow, FALSE, FALSE, FALSE, 'After tomorrow at 03:00 AM.'],
['0,1,2,3,4,5 1 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE, 'After tomorrow at 01:00-05 AM.'],
['* * * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE,
'Every minute tomorrow.',
],
['0 0 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE,
'Tomorrow at 00:00 AM.',
],
['0 1 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE,
'Tomorrow at 01:00 AM.',
],
['0 2 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE,
'Tomorrow at 02:00 AM.',
],
['0 3 * * ' . $weekday_tomorrow, FALSE, FALSE, FALSE,
'Tomorrow at 03:00 AM.',
],
['0,1,2,3,4,5 1 * * ' . $weekday_tomorrow, FALSE, TRUE, FALSE,
'Tomorrow at 01:00-05 AM.',
],
['* * * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE,
'Every minute after tomorrow.',
],
['0 0 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE,
'After tomorrow at 00:00 AM.',
],
['0 1 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE,
'After tomorrow at 01:00 AM.',
],
['0 2 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE,
'After tomorrow at 02:00 AM.',
],
['0 3 * * ' . $weekday_after_tomorrow, FALSE, FALSE, FALSE,
'After tomorrow at 03:00 AM.',
],
['0,1,2,3,4,5 1 * * ' . $weekday_after_tomorrow, FALSE, FALSE, TRUE,
'After tomorrow at 01:00-05 AM.',
],
];
}
......
......@@ -210,7 +210,7 @@ class KernelEventTest extends KernelTestBase {
'label' => 'request write',
'configuration' => [
'key' => 'request',
'value' => 'request [event:machine-name] [event:method]'
'value' => 'request [event:machine-name] [event:method]',
],
'successors' => [],
],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment