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/**
1315 * @author Kévin Dunglas <kevin@dunglas.dev>
1416 */
1517final class RuntimeTest extends TestCase
1618{
19+ protected function setUp (): void
20+ {
21+ parent ::setUp ();
22+ unset($ _SERVER ['FRANKENPHP_WORKER ' ]);
23+ }
24+
1725 public function testGetRunner (): void
1826 {
1927 $ application = $ this ->createStub (HttpKernelInterface::class);
@@ -25,4 +33,16 @@ public function testGetRunner(): void
2533 $ _SERVER ['FRANKENPHP_WORKER ' ] = 1 ;
2634 $ this ->assertInstanceOf (Runner::class, $ runtime ->getRunner ($ application ));
2735 }
36+
37+ public function testGetResponseRunner (): void
38+ {
39+ $ application = $ this ->createStub (Response::class);
40+
41+ $ runtime = new Runtime ();
42+ $ this ->assertNotInstanceOf (ResponseRunner::class, $ runtime ->getRunner (null ));
43+ $ this ->assertNotInstanceOf (ResponseRunner::class, $ runtime ->getRunner ($ application ));
44+
45+ $ _SERVER ['FRANKENPHP_WORKER ' ] = 1 ;
46+ $ this ->assertInstanceOf (ResponseRunner::class, $ runtime ->getRunner ($ application ));
47+ }
2848}
0 commit comments