Skip to content

Commit 2b56534

Browse files
committed
Fix tests
1 parent 0c98e85 commit 2b56534

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

tests/Renderer/PlainTextRendererTest.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,24 @@ public function testRenderVerbose(): void
2222
{
2323
$renderer = new PlainTextRenderer();
2424
$throwable = new RuntimeException();
25-
$data = $renderer->renderVerbose($throwable);
26-
$content = RuntimeException::class . " with message '{$throwable->getMessage()}' \n\nin "
27-
. $throwable->getFile() . ':' . $throwable->getLine() . "\n\n"
28-
. "Stack trace:\n" . $throwable->getTraceAsString()
29-
;
25+
$expectedContent = sprintf(
26+
<<<TEXT
27+
%s with message "%s"
28+
29+
in %s:%s
3030
31-
$this->assertSame($content, (string) $data);
31+
Stack trace:
32+
%s
33+
TEXT,
34+
$throwable::class,
35+
$throwable->getMessage(),
36+
$throwable->getFile(),
37+
$throwable->getLine(),
38+
$throwable->getTraceAsString()
39+
);
40+
41+
$data = $renderer->renderVerbose($throwable);
42+
$this->assertSame($expectedContent, (string) $data);
43+
$this->assertSame($expectedContent, PlainTextRenderer::throwableToString($throwable));
3244
}
3345
}

0 commit comments

Comments
 (0)