5
5
namespace Runtime \FrankenPhpSymfony \Tests ;
6
6
7
7
use PHPUnit \Framework \TestCase ;
8
+ use Runtime \FrankenPhpSymfony \ResponseRunner ;
8
9
use Runtime \FrankenPhpSymfony \Runner ;
9
10
use Runtime \FrankenPhpSymfony \Runtime ;
11
+ use Symfony \Component \HttpFoundation \Response ;
10
12
use Symfony \Component \HttpKernel \HttpKernelInterface ;
11
13
12
14
/**
@@ -16,6 +18,7 @@ final class RuntimeTest extends TestCase
16
18
{
17
19
public function testGetRunner (): void
18
20
{
21
+ unset($ _SERVER ['FRANKENPHP_WORKER ' ]);
19
22
$ application = $ this ->createStub (HttpKernelInterface::class);
20
23
21
24
$ runtime = new Runtime ();
@@ -25,4 +28,17 @@ public function testGetRunner(): void
25
28
$ _SERVER ['FRANKENPHP_WORKER ' ] = 1 ;
26
29
$ this ->assertInstanceOf (Runner::class, $ runtime ->getRunner ($ application ));
27
30
}
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
+ }
28
44
}
0 commit comments