55namespace Runtime \FrankenPhpSymfony \Tests ;
66
77use PHPUnit \Framework \TestCase ;
8+ use Runtime \FrankenPhpSymfony \ResponseRunner ;
89use Runtime \FrankenPhpSymfony \Runner ;
910use Runtime \FrankenPhpSymfony \Runtime ;
11+ use Symfony \Component \HttpFoundation \Response ;
1012use Symfony \Component \HttpKernel \HttpKernelInterface ;
1113
1214/**
@@ -16,6 +18,7 @@ final class RuntimeTest extends TestCase
1618{
1719 public function testGetRunner (): void
1820 {
21+ unset($ _SERVER ['FRANKENPHP_WORKER ' ]);
1922 $ application = $ this ->createStub (HttpKernelInterface::class);
2023
2124 $ runtime = new Runtime ();
@@ -25,4 +28,17 @@ public function testGetRunner(): void
2528 $ _SERVER ['FRANKENPHP_WORKER ' ] = 1 ;
2629 $ this ->assertInstanceOf (Runner::class, $ runtime ->getRunner ($ application ));
2730 }
31+
32+ public function testGetResponseRunner (): void
33+ {
34+ unset($ _SERVER ['FRANKENPHP_WORKER ' ]);
35+ $ application = $ this ->createStub (Response::class);
36+
37+ $ runtime = new Runtime ();
38+ $ this ->assertNotInstanceOf (ResponseRunner::class, $ runtime ->getRunner (null ));
39+ $ this ->assertNotInstanceOf (ResponseRunner::class, $ runtime ->getRunner ($ application ));
40+
41+ $ _SERVER ['FRANKENPHP_WORKER ' ] = 1 ;
42+ $ this ->assertInstanceOf (ResponseRunner::class, $ runtime ->getRunner ($ application ));
43+ }
2844}
0 commit comments