/** * @group cronCompile */ public function testUnitMethods() { $id = uniqid(); $e = new Event($this->id, 'php foo'); $this->assertEquals('0 * * * * *', $e->hourly()->getExpression()); $e = new Event($this->id, 'php bar'); $this->assertEquals('0 0 * * * *', $e->daily()->getExpression()); $e = new Event($this->id, 'php foo'); $this->assertEquals('45 15 * * * *', $e->dailyAt('15:45')->getExpression()); $e = new Event($this->id, 'php bar'); $this->assertEquals('0 4,8 * * * *', $e->twiceDaily(4, 8)->getExpression()); $e = new Event($this->id, 'php foo'); $this->assertEquals('0 0 * * 0 *', $e->weekly()->getExpression()); $e = new Event($this->id, 'php bar'); $this->assertEquals('0 0 1 * * *', $e->monthly()->getExpression()); $e = new Event($this->id, 'php foo'); $this->assertEquals('0 0 1 */3 * *', $e->quarterly()->getExpression()); $e = new Event($this->id, 'php bar'); $this->assertEquals('0 0 1 1 * *', $e->yearly()->getExpression()); }