-
Notifications
You must be signed in to change notification settings - Fork 26
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
No way to pass mocked SoapClient in tests #45
Comments
Can you paste your testing code? Or create a Gist containing the files |
Currently i use Laravel container to Mock Serivce In application
in test
But as you can see, it's very complicated solution. |
I currently don't see a solution to solve your issue. It's working this way and modifying it would myabe break the usage long ago designed as it is. |
One of improvement that i currently can see, is to add config option for class name, and pass this option to getSoapClientClassName in initSoapClient, because currently there is no other way to pass any value to getSoapClientClassName |
Maybe I'm wrong but imagine you:
|
Trying to write tests for next case. My app is calling soap service and correctly stores response to db. I have many response xml examples from service documentation app, so I use Mockery::mock(\SoapClient::class) to make partial mock and override __doRequest method to return expected xml.
But after that i have no way to pass this class to AbstractSoapClientBase descendant. What i see:
The text was updated successfully, but these errors were encountered: