Lines Matching defs:CronExpression
5 use Cron\CronExpression;
17 * @covers Cron\CronExpression::factory
21 $this->assertEquals('0 0 1 1 *', CronExpression::factory('@annually')->getExpression());
22 $this->assertEquals('0 0 1 1 *', CronExpression::factory('@yearly')->getExpression());
23 $this->assertEquals('0 0 * * 0', CronExpression::factory('@weekly')->getExpression());
27 * @covers Cron\CronExpression::__construct
28 * @covers Cron\CronExpression::getExpression
29 * @covers Cron\CronExpression::__toString
34 $cron = CronExpression::factory('1 2-4 * 4,5,6 */3');
35 $this->assertEquals('1', $cron->getExpression(CronExpression::MINUTE));
36 $this->assertEquals('2-4', $cron->getExpression(CronExpression::HOUR));
37 $this->assertEquals('*', $cron->getExpression(CronExpression::DAY));
38 $this->assertEquals('4,5,6', $cron->getExpression(CronExpression::MONTH));
39 $this->assertEquals('*/3', $cron->getExpression(CronExpression::WEEKDAY));
45 $cron = CronExpression::factory('A 1 2 3 4');
52 * @covers Cron\CronExpression::__construct
53 * @covers Cron\CronExpression::getExpression
58 $cron = CronExpression::factory($schedule);
59 $this->assertEquals($expected[0], $cron->getExpression(CronExpression::MINUTE));
60 $this->assertEquals($expected[1], $cron->getExpression(CronExpression::HOUR));
61 $this->assertEquals($expected[2], $cron->getExpression(CronExpression::DAY));
62 $this->assertEquals($expected[3], $cron->getExpression(CronExpression::MONTH));
63 $this->assertEquals($expected[4], $cron->getExpression(CronExpression::WEEKDAY));
64 $this->assertEquals($expected[5], $cron->getExpression(CronExpression::YEAR));
83 * @covers Cron\CronExpression::__construct
84 * @covers Cron\CronExpression::setExpression
85 * @covers Cron\CronExpression::setPart
91 $cron = CronExpression::factory('* * * 1');
95 * @covers Cron\CronExpression::setPart
101 $cron = CronExpression::factory('* * * * *');
181 * @covers Cron\CronExpression::isDue
182 * @covers Cron\CronExpression::getNextRunDate
189 * @covers Cron\CronExpression::getRunDate
197 $cron = CronExpression::factory($schedule);
209 * @covers Cron\CronExpression::isDue
213 $cron = CronExpression::factory('* * * * *');
221 * @covers Cron\CronExpression::isDue
225 $cron = CronExpression::factory('0 15 * * 3'); //Wednesday at 15:00
248 * @covers Cron\CronExpression::getPreviousRunDate
252 $cron = CronExpression::factory('* * * * *');
257 $cron = CronExpression::factory('* */2 * * *');
262 $cron = CronExpression::factory('* * * */2 *');
269 * @covers Cron\CronExpression::getMultipleRunDates
273 $cron = CronExpression::factory('*/2 * * * *');
283 * @covers Cron\CronExpression::getMultipleRunDates
284 * @covers Cron\CronExpression::setMaxIterationCount
288 $cron = CronExpression::factory('0 0 12 1 * */2');
304 * @covers Cron\CronExpression
308 $cron = CronExpression::factory('@weekly');
328 * @covers Cron\CronExpression::getRunDate
332 $cron = CronExpression::factory('* * * * *');
340 * @covers Cron\CronExpression::getRunDate
345 $cron = CronExpression::factory('* * * * *');
351 * @covers Cron\CronExpression::getRunDate
355 $cron = CronExpression::factory('0 0 27 JAN *');
361 $cron = CronExpression::factory('@weekly');
372 $e = CronExpression::factory('* * * * MON#1');
377 $e = CronExpression::factory('* * * * SAT#2');
382 $e = CronExpression::factory('* * * * SUN#3');
389 * @covers Cron\CronExpression::getRunDate
395 $cron = CronExpression::factory('0 0 * * *');
401 * @covers Cron\CronExpression::__construct
402 * @covers Cron\CronExpression::factory
403 * @covers Cron\CronExpression::isValidExpression
404 * @covers Cron\CronExpression::setExpression
405 * @covers Cron\CronExpression::setPart
410 $this->assertFalse(CronExpression::isValidExpression('* * * 1'));
412 $this->assertTrue(CronExpression::isValidExpression('* * * * 1'));