| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | protected function catchExpectedException(string $exception, \Closure $callback) { |
||
| 21 | |||
| 22 | try { |
||
| 23 | $callback(); |
||
| 24 | } catch (\Exception $e) { |
||
| 25 | $this->assertEquals($exception, get_class($e)); |
||
| 26 | return; |
||
| 27 | } |
||
| 28 | |||
| 29 | throw new \RuntimeException('Expected exception not thrown: ' . $exception); |
||
| 30 | } |
||
| 31 | } |