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