| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function testSimpleCronJobRun() |
||
| 21 | { |
||
| 22 | $cron = new Cron(); |
||
| 23 | $mock = $this->getMockBuilder('stdClass') |
||
| 24 | ->setMethods(['callback']) |
||
| 25 | ->getMock(); |
||
| 26 | $mock->expects($this->exactly(2))->method('callback'); |
||
| 27 | $cron->addCronJob('foo', '+1 day', [$mock, 'callback']); |
||
| 28 | |||
| 29 | $mock = $this->getMockBuilder('stdClass') |
||
| 30 | ->setMethods(['callback']) |
||
| 31 | ->getMock(); |
||
| 32 | $mock->expects($this->exactly(3))->method('callback'); |
||
| 33 | $cron->addCronJob('bar', '-1 day', [$mock, 'callback']); |
||
| 34 | |||
| 35 | $cron->execute(); |
||
| 36 | $cron->execute(); |
||
| 37 | $cron->clearHistory(); |
||
| 38 | $cron->execute(); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |