| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function testFormat() |
||
| 12 | { |
||
| 13 | $generator = new ErrorGenerator(); |
||
| 14 | $formatter = new DetailedErrorFormatter(); |
||
| 15 | $exception = $generator->mockException(); |
||
| 16 | |||
| 17 | $output = ''.$formatter->format(['context' => [ |
||
| 18 | 'exception' => $exception, |
||
| 19 | ]]); |
||
| 20 | |||
| 21 | $base = __DIR__; |
||
| 22 | $this->assertContains('ERROR [Emergency]: Uncaught Exception: Error', $output); |
||
| 23 | $this->assertContains("Line 32 in $base/DetailedErrorFormatterTest/ErrorGenerator.php", $output); |
||
| 24 | $this->assertContains('* 32: throw new Exception(\'Error\');', $output); |
||
| 25 | $this->assertContains( |
||
| 26 | 'SilverStripe\\Logging\\Tests\\DetailedErrorFormatterTest\\ErrorGenerator->mockException(4)', |
||
| 27 | $output |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |