Escape LegacyDevelopmentTest output

main
Igor Scheller 5 years ago
parent 59e060cd39
commit ba1c658b92

@ -26,7 +26,13 @@ class LegacyDevelopment extends Legacy
'file' => $file . ':' . $e->getLine(), 'file' => $file . ':' . $e->getLine(),
'stacktrace' => $this->formatStackTrace($e->getTrace()), 'stacktrace' => $this->formatStackTrace($e->getTrace()),
]; ];
ob_start(function (string $buffer) {
return htmlspecialchars($buffer);
});
var_dump($data); var_dump($data);
ob_end_flush();
echo '</pre>'; echo '</pre>';
} }

@ -19,10 +19,10 @@ class LegacyDevelopmentTest extends TestCase
$handler = new LegacyDevelopment(); $handler = new LegacyDevelopment();
/** @var Request|MockObject $request */ /** @var Request|MockObject $request */
$request = $this->createMock(Request::class); $request = $this->createMock(Request::class);
$exception = new ErrorException('Lorem Ipsum', 4242, 1, 'foo.php', 9999); $exception = new ErrorException('Lorem <b>Ipsum</b>', 4242, 1, 'foo.php', 9999);
$regex = sprintf( $regex = sprintf(
'%%<pre.*>.*ErrorException.*4242.*Lorem Ipsum.*%s.*%s.*%s.*</pre>%%is', '%%<pre.*>.*ErrorException.*4242.*Lorem &lt;b&gt;Ipsum&lt;/b&gt;.*%s.*%s.*%s.*</pre>%%is',
'foo.php', 'foo.php',
9999, 9999,
__FUNCTION__ __FUNCTION__

Loading…
Cancel
Save