-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I mock behavior of the services in the 'fob_symfony.driver_kernel'? #94
Comments
For now, you are probably forced to write some dummy implementation and load it only in test env, so DI will handle mocking. However some support for prophecy could be useful, but probably it won't be easy to implement. @pamil is it something that we would like to support? |
But if i implement static dummy implementation this will work only for one case. @lchrusciel Can I get access to kernel object that set to mink driver? If I can get access to him I can configure it as i want using that mock library that i want(prophecy, phpunit, etc). |
This issue is probably a bit related to #86, defining a stable way to get to and modify those services in Mink kernel would be certainly beneficial, although I don't have any good ideas for it now. |
After #116 is merged, you can inject |
I've released v2.1.0-BETA.2 with #116 that should help with it. I'll close this issue, please open a new one if it isn't enough. |
User case:
I need to mock some services while api testing
I get from kernel instance some services and put on this service some dummy(using Prophecy)
But when behat steps are passed and request to kernel is started, kernel object have no mocked objects at all (I think this is because of two kernel's loaded)
\FriendsOfBehat\SymfonyExtension\ServiceContainer\SymfonyExtension::load $this->loadKernel($container, $this->autodiscoverKernelConfiguration($config['kernel'])); $this->loadDriverKernel($container);
I try to pass 'fob_symfony.driver_kernel' service to BehatContext to change it behavior but service doesnot exist.
How can I mock behavior of the services in the 'fob_symfony.driver_kernel'?
I use:
The text was updated successfully, but these errors were encountered: