You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using symfony\browserkit component in integration tests with nette application, the problem is return type from DI container for service http.response is specific class instead of interface, which prevents replacing it with own implementation
Nette\InvalidArgumentException : Service 'http.response' must be instance of Nette\Http\Response, NBrowserKit\Response given.
/home/users/klarka/wc/17/vendor/nette/di/src/DI/Container.php:83
/home/users/klarka/wc/17/tests/Integration/BrowserClient.php:33
/home/users/klarka/wc/17/vendor/symfony/browser-kit/Client.php:407
/home/users/klarka/wc/17/tests/Integration/Cache/Nocache/NoCacheTest.php:36
Steps To Reproduce
Replace response service with IResponse implementation but not Nette\Http\Response
Version: 3.0.2
Bug Description
I am using symfony\browserkit component in integration tests with nette application, the problem is return type from DI container for service
http.response
is specific class instead of interface, which prevents replacing it with own implementationHere is the response source code: https://github.com/NBrowserKit/NBrowserKit/blob/v2.0.0/src/NetteResponseProxy.php
and i receive
Steps To Reproduce
Replace response service with
IResponse
implementation but notNette\Http\Response
Expected Behavior
To work :-)
Possible Solution
src/Bridges/HttpDI/HttpExtension.php:
$response = $builder->addDefinition($this->prefix('response')) + ->setType(Nette\Http\IResponse::class) ->setFactory(Nette\Http\Response::class);
The text was updated successfully, but these errors were encountered: