Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | class Psr15ToSymfonyBridgeTest extends TestCase |
||
15 | { |
||
16 | public function testProcess() |
||
17 | { |
||
18 | // Symfony middleware that returns 'foo' |
||
19 | $symfonyMiddleware = new class implements HttpKernelInterface |
||
20 | { |
||
21 | public function handle(SymfonyRequest $request, $type = self::MASTER_REQUEST, $catch = true) |
||
22 | { |
||
23 | return new SymfonyResponse('foo'); |
||
24 | } |
||
25 | }; |
||
26 | |||
27 | $delegate = $this->createMock(RequestHandlerInterface::class); |
||
28 | |||
29 | $bridge = new Psr15ToSymfonyBridge($symfonyMiddleware); |
||
30 | |||
31 | $request = new ServerRequest([], [], new Uri('/'), 'GET'); |
||
32 | $response = $bridge->process($request, $delegate); |
||
|
|||
33 | |||
34 | $this->assertEquals('foo', (string) $response->getBody()); |
||
37 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: