| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function testAll() |
||
| 21 | { |
||
| 22 | $mock = $this->getMockBuilder('stdClass') |
||
| 23 | ->setMethods(['callback']) |
||
| 24 | ->getMock(); |
||
| 25 | $mock->expects($this->once())->method('callback'); |
||
| 26 | |||
| 27 | $due = '+1 day'; |
||
| 28 | $job = new CronJob('foo', $due, [$mock, 'callback']); |
||
| 29 | |||
| 30 | $this->assertEquals('foo', $job->getUid()); |
||
| 31 | $due = new \DateTimeImmutable($due); |
||
| 32 | $this->assertWithinRange($due->getTimestamp(), $job->getDue(), 2); |
||
| 33 | |||
| 34 | $job->execute(); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |