File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ private function formatExceptionFragment(Throwable $exception): string
46
46
/** @var int|string $code */
47
47
$ text .= sprintf ("Code: %s \n" , $ code );
48
48
49
- $ text .= sprintf ("Message: %s \n" , htmlentities ( $ exception ->getMessage () ));
49
+ $ text .= sprintf ("Message: %s \n" , $ exception ->getMessage ());
50
50
51
51
$ text .= sprintf ("File: %s \n" , $ exception ->getFile ());
52
52
Original file line number Diff line number Diff line change @@ -202,19 +202,24 @@ public function testXMLErrorRendererRenderHttpException()
202
202
203
203
public function testPlainTextErrorRendererFormatFragmentMethod ()
204
204
{
205
- $ exception = new Exception ('Oops.. ' , 500 );
205
+ $ message = 'Oops.. <br> ' ;
206
+ $ exception = new Exception ($ message , 500 );
206
207
$ renderer = new PlainTextErrorRenderer ();
207
208
$ reflectionRenderer = new ReflectionClass (PlainTextErrorRenderer::class);
208
209
209
210
$ method = $ reflectionRenderer ->getMethod ('formatExceptionFragment ' );
210
211
$ method ->setAccessible (true );
211
212
$ output = $ method ->invoke ($ renderer , $ exception );
213
+ $ this ->assertIsString ($ output );
212
214
213
215
$ this ->assertMatchesRegularExpression ('/.*Type:*/ ' , $ output );
214
216
$ this ->assertMatchesRegularExpression ('/.*Code:*/ ' , $ output );
215
217
$ this ->assertMatchesRegularExpression ('/.*Message*/ ' , $ output );
216
218
$ this ->assertMatchesRegularExpression ('/.*File*/ ' , $ output );
217
219
$ this ->assertMatchesRegularExpression ('/.*Line*/ ' , $ output );
220
+
221
+ // ensure the renderer doesn't reformat the message
222
+ $ this ->assertMatchesRegularExpression ("/.* $ message/ " , $ output );
218
223
}
219
224
220
225
public function testPlainTextErrorRendererDisplaysErrorDetails ()
You can’t perform that action at this time.
0 commit comments