/** * {@inheritdoc} */ public function isDue($date = 'now') { if (!$date instanceof \DateTime) { $date = new \DateTime($date); } return $this->expression->matches($date); }
/** * @covers CronExpression::__construct * @covers CronExpression::getExpression * @covers CronExpression::setExpression */ public function setExpression() { $expression = new CronExpression('* * * * *'); $expression->setExpression('@hourly'); $this->assertEquals('0 * * * *', $expression->getExpression()); }