Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit da0536d

Browse files
committed
Enhancing CodeCoverage
1 parent 668a26b commit da0536d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Test/TestData.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ public static function getYamlConfigFile()
4747
*/
4848
public static function getYamlTimerConfigFile()
4949
{
50+
$today = new \DateTime();
51+
$tomorrow = new \DateTime('tomorrow');
52+
5053
return <<<EOT
5154
timers:
5255
example_timer_config_1:
5356
interval:
5457
- [ "2013-02-06" ] # 00:00:00 - 23:59:59
55-
- [ "2013-04-24 00:00:01", "2013-04-28 23:59:59" ]
58+
- [ "{$today->format('Y-m-d H:i:s')}", "{$tomorrow->format('Y-m-d H:i:s')}" ]
5659
5760
example_timer_config_2:
5861
interval:

Timer/Timer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ private function checkIntervals(array $intervals = array())
227227
$intervalEnd = $today->diff($interval[1]);
228228

229229
// check if current date has passed start but not endtime
230-
if ((1 == $intervalStart->invert)
231-
&& (0 == $intervalEnd->invert)
232-
) {
230+
if ((1 == $intervalStart->invert) && (0 == $intervalEnd->invert)) {
233231
$return = true;
234232
break;
235233
}

0 commit comments

Comments
 (0)