Skip to content

Commit ab42898

Browse files
added delta for date check
1 parent 0589418 commit ab42898

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/Unit/Command/ScheduleTaskCommandTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,17 @@ public function testRun($handler, $workload = null, $cronExpression = null, $end
7373
$endDate = new \DateTime($endDateString);
7474
}
7575

76-
$taskBuilder->cron($cronExpression, Argument::type(\DateTime::class), $endDate)->shouldBeCalled()
76+
$taskBuilder->cron(
77+
$cronExpression,
78+
Argument::type(\DateTime::class),
79+
Argument::that(
80+
function ($argument) use ($endDate) {
81+
$this->assertEquals($endDate, $argument, '', 2);
82+
83+
return true;
84+
}
85+
)
86+
)->shouldBeCalled()
7787
->willReturn($taskBuilder->reveal());
7888
} else {
7989
$taskBuilder->cron(Argument::any(), Argument::any(), Argument::any())->shouldNotBeCalled()

0 commit comments

Comments
 (0)