@@ -507,7 +507,7 @@ public function testDontRunAlternativeNamespaceName()
507
507
Did you mean this?
508
508
foo
509
509
510
-
510
+
511
511
' , $ tester ->getDisplay (true ));
512
512
}
513
513
@@ -868,9 +868,12 @@ public function testRenderExceptionEscapesLines()
868
868
$ application = new Application ();
869
869
$ application ->setAutoExit (false );
870
870
putenv ('COLUMNS=22 ' );
871
- $ application ->register ('foo ' )->setCode (function () {
872
- throw new \Exception ('dont break here <info>!</info> ' );
873
- });
871
+ $ application
872
+ ->register ('foo ' )
873
+ ->setCode (function () {
874
+ throw new \Exception ('dont break here <info>!</info> ' );
875
+ })
876
+ ;
874
877
$ tester = new ApplicationTester ($ application );
875
878
876
879
$ tester ->run (['command ' => 'foo ' ], ['decorated ' => false ]);
@@ -940,6 +943,23 @@ public function testRenderExceptionStackTraceContainsRootException()
940
943
$ this ->assertStringContainsString ('Dummy type "class@anonymous" is invalid. ' , $ tester ->getDisplay (true ));
941
944
}
942
945
946
+ public function testRenderExceptionEscapesLinesOfSynopsis ()
947
+ {
948
+ $ application = new Application ();
949
+ $ application ->setAutoExit (false );
950
+ $ application
951
+ ->register ('foo ' )
952
+ ->setCode (function () {
953
+ throw new \Exception ('some exception ' );
954
+ })
955
+ ->addArgument ('info ' )
956
+ ;
957
+ $ tester = new ApplicationTester ($ application );
958
+
959
+ $ tester ->run (['command ' => 'foo ' ], ['decorated ' => false ]);
960
+ $ this ->assertStringMatchesFormatFile (self ::$ fixturesPath .'/application_rendersynopsis_escapesline.txt ' , $ tester ->getDisplay (true ), '->renderException() escapes lines containing formatting of synopsis ' );
961
+ }
962
+
943
963
public function testRun ()
944
964
{
945
965
$ application = new Application ();
0 commit comments