@@ -49,25 +49,6 @@ public function getInitializedVar()
4949 $ this ->assertTrue ($ engine ->response ()->content_length );
5050 }
5151
52- public function testInitBeforeStartV2OutputBuffering (): void
53- {
54- $ engine = new class extends Engine {
55- public function getInitializedVar (): bool
56- {
57- return $ this ->initialized ;
58- }
59- };
60- $ engine ->set ('flight.v2.output_buffering ' , true );
61- $ this ->assertTrue ($ engine ->getInitializedVar ());
62- $ engine ->start ();
63-
64- // This is a necessary evil because of how the v2 output buffer works.
65- ob_end_clean ();
66-
67- $ this ->assertFalse ($ engine ->router ()->caseSensitive );
68- $ this ->assertTrue ($ engine ->response ()->content_length );
69- }
70-
7152 public function testHandleErrorNoErrorNumber (): void
7253 {
7354 $ engine = new Engine ();
@@ -322,34 +303,6 @@ public function setRealHeader(string $header_string, bool $replace = true, int $
322303 $ this ->assertEquals (500 , $ engine ->response ()->status ());
323304 }
324305
325- public function testStopWithCodeV2OutputBuffering (): void
326- {
327- $ engine = new class extends Engine {
328- public function getLoader ()
329- {
330- return $ this ->loader ;
331- }
332- };
333- // doing this so we can overwrite some parts of the response
334- $ engine ->getLoader ()->register ('response ' , function () {
335- return new class extends Response {
336- public function setRealHeader (string $ header_string , bool $ replace = true , int $ response_code = 0 ): self
337- {
338- return $ this ;
339- }
340- };
341- });
342- $ engine ->set ('flight.v2.output_buffering ' , true );
343- $ engine ->route ('/testRoute ' , function () use ($ engine ) {
344- echo 'I am a teapot ' ;
345- $ engine ->stop (500 );
346- });
347- $ engine ->request ()->url = '/testRoute ' ;
348- $ engine ->start ();
349- $ this ->expectOutputString ('I am a teapot ' );
350- $ this ->assertEquals (500 , $ engine ->response ()->status ());
351- }
352-
353306 public function testPostRoute (): void
354307 {
355308 $ engine = new Engine ();
@@ -519,16 +472,6 @@ public function testJsonThrowOnErrorByDefault(): void
519472 $ engine ->json (['key1 ' => 'value1 ' , 'key2 ' => 'value2 ' , 'utf8_emoji ' => "\xB1\x31" ]);
520473 }
521474
522- public function testJsonV2OutputBuffering (): void
523- {
524- $ engine = new Engine ();
525- $ engine ->response ()->v2_output_buffering = true ;
526- $ engine ->json (['key1 ' => 'value1 ' , 'key2 ' => 'value2 ' ]);
527- $ this ->expectOutputString ('{"key1":"value1","key2":"value2"} ' );
528- $ this ->assertEquals ('application/json ' , $ engine ->response ()->headers ()['Content-Type ' ]);
529- $ this ->assertEquals (200 , $ engine ->response ()->status ());
530- }
531-
532475 public function testJsonHalt (): void
533476 {
534477 $ engine = new Engine ();
@@ -549,17 +492,6 @@ public function testJsonP(): void
549492 $ this ->assertEquals ('whatever({"key1":"value1","key2":"value2"}); ' , $ engine ->response ()->getBody ());
550493 }
551494
552- public function testJsonPV2OutputBuffering (): void
553- {
554- $ engine = new Engine ();
555- $ engine ->response ()->v2_output_buffering = true ;
556- $ engine ->request ()->query ['jsonp ' ] = 'whatever ' ;
557- $ engine ->jsonp (['key1 ' => 'value1 ' , 'key2 ' => 'value2 ' ]);
558- $ this ->expectOutputString ('whatever({"key1":"value1","key2":"value2"}); ' );
559- $ this ->assertEquals ('application/javascript; charset=utf-8 ' , $ engine ->response ()->headers ()['Content-Type ' ]);
560- $ this ->assertEquals (200 , $ engine ->response ()->status ());
561- }
562-
563495 public function testJsonpBadParam (): void
564496 {
565497 $ engine = new Engine ();
@@ -569,16 +501,6 @@ public function testJsonpBadParam(): void
569501 $ this ->assertEquals (200 , $ engine ->response ()->status ());
570502 }
571503
572- public function testJsonpBadParamV2OutputBuffering (): void
573- {
574- $ engine = new Engine ();
575- $ engine ->response ()->v2_output_buffering = true ;
576- $ engine ->jsonp (['key1 ' => 'value1 ' , 'key2 ' => 'value2 ' ]);
577- $ this ->expectOutputString ('({"key1":"value1","key2":"value2"}); ' );
578- $ this ->assertEquals ('application/javascript; charset=utf-8 ' , $ engine ->response ()->headers ()['Content-Type ' ]);
579- $ this ->assertEquals (200 , $ engine ->response ()->status ());
580- }
581-
582504 public function testEtagSimple (): void
583505 {
584506 $ engine = new Engine ();
0 commit comments