cron() public method

The Cron expression representing the event's frequency.
public cron ( string $expression )
$expression string
Example #1
0
 public function testCronConditions()
 {
     $e = new Event($this->id, 'php foo');
     $this->assertFalse($e->cron('* * * * * *')->when(function () {
         return false;
     })->isDue());
     $e = new Event($this->id, 'php foo');
     $this->assertTrue($e->cron('* * * * * *')->when(function () {
         return true;
     })->isDue());
     $e = new Event($this->id, 'php foo');
     $this->assertFalse($e->cron('* * * * * *')->skip(function () {
         return true;
     })->isDue());
     $e = new Event($this->id, 'php foo');
     $this->assertTrue($e->cron('* * * * * *')->skip(function () {
         return false;
     })->isDue());
 }