| Conditions | 2 |
| Paths | 3 |
| Total Lines | 7 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Chekote\PHPUnit\Framework; |
||
| 22 | public function assertException(Exception $expected, callable $lambda): void { |
||
| 23 | try { |
||
| 24 | $lambda(); |
||
| 25 | $this->fail(get_class($expected) . ' was not thrown'); |
||
| 26 | } catch (Throwable | Exception $actual) { |
||
| 27 | $this->assertThat($actual, new PHPUnit_Framework_Constraint_Exception(get_class($expected))); |
||
| 28 | $this->assertThat($actual, new PHPUnit_Framework_Constraint_ExceptionMessage($expected->getMessage())); |
||
| 29 | } |
||
| 32 |