| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | protected function assertDateTimeEquals($expected, $actual, $threshold = 10) |
||
| 17 | { |
||
| 18 | $this->assertInstanceOf('\DateTime', $expected); |
||
| 19 | $this->assertInstanceOf('\DateTime', $actual); |
||
| 20 | |||
| 21 | $diff = abs($expected->getTimestamp() - $actual->getTimestamp()); |
||
| 22 | |||
| 23 | $this->assertLessThan( |
||
| 24 | $threshold, |
||
| 25 | $diff, |
||
| 26 | 'Date objects differ too much (' . $diff . ' seconds, treshold is ' . $threshold . ')' |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |