@@ -55,9 +55,13 @@ public function setUp()
5555 public function testWritesResultsOfWhoopsExceptionsHandlingToResponse ()
5656 {
5757 $ error = new RuntimeException ();
58+ $ sendOutput = true ;
5859
5960 $ this ->whoops ->getHandlers ()->willReturn ([]);
6061 $ this ->whoops ->handleException ($ error )->willReturn ('WHOOPS ' );
62+ $ this ->whoops ->writeToOutput ()->willReturn ($ sendOutput );
63+ $ this ->whoops ->writeToOutput (false )->shouldBeCalled ();
64+ $ this ->whoops ->writeToOutput ($ sendOutput )->shouldBeCalled ();
6165
6266 // Could do more assertions here, but these will be sufficent for
6367 // ensuring that the method for injecting metadata is never called.
@@ -81,6 +85,7 @@ public function testWritesResultsOfWhoopsExceptionsHandlingToResponse()
8185 public function testAddsRequestMetadataToWhoopsPrettyPageHandler ()
8286 {
8387 $ error = new RuntimeException ('STATUS_INTERNAL_SERVER_ERROR ' , StatusCode::STATUS_INTERNAL_SERVER_ERROR );
88+ $ sendOutput = true ;
8489
8590 $ handler = $ this ->prophesize (PrettyPageHandler::class);
8691 $ handler
@@ -98,6 +103,9 @@ public function testAddsRequestMetadataToWhoopsPrettyPageHandler()
98103
99104 $ this ->whoops ->getHandlers ()->willReturn ([$ handler ->reveal ()]);
100105 $ this ->whoops ->handleException ($ error )->willReturn ('WHOOPS ' );
106+ $ this ->whoops ->writeToOutput ()->willReturn ($ sendOutput );
107+ $ this ->whoops ->writeToOutput (false )->shouldBeCalled ();
108+ $ this ->whoops ->writeToOutput ($ sendOutput )->shouldBeCalled ();
101109
102110 $ this ->request ->getAttribute ('originalUri ' , false )->willReturn ('https://example.com/foo ' );
103111 $ this ->request ->getAttribute ('originalRequest ' , false )->will ([$ this ->request , 'reveal ' ]);
@@ -126,6 +134,7 @@ public function testAddsRequestMetadataToWhoopsPrettyPageHandler()
126134 public function testJsonContentTypeResponseWithJsonResponseHandler ()
127135 {
128136 $ error = new RuntimeException ('STATUS_NOT_IMPLEMENTED ' , StatusCode::STATUS_NOT_IMPLEMENTED );
137+ $ sendOutput = true ;
129138
130139 $ handler = $ this ->prophesize (JsonResponseHandler::class);
131140
@@ -135,6 +144,9 @@ public function testJsonContentTypeResponseWithJsonResponseHandler()
135144
136145 $ this ->whoops ->getHandlers ()->willReturn ([$ handler ->reveal ()]);
137146 $ this ->whoops ->handleException ($ error )->willReturn ('error ' );
147+ $ this ->whoops ->writeToOutput ()->willReturn ($ sendOutput );
148+ $ this ->whoops ->writeToOutput (false )->shouldBeCalled ();
149+ $ this ->whoops ->writeToOutput ($ sendOutput )->shouldBeCalled ();
138150
139151 $ this ->request ->getAttribute ('originalUri ' , false )->willReturn ('https://example.com/foo ' );
140152 $ this ->request ->getAttribute ('originalRequest ' , false )->will ([$ this ->request , 'reveal ' ]);
0 commit comments