I am trying to make fun of SoapClient with the following code:
$soapClientMock = $this->getMockBuilder('SoapClient') ->disableOriginalConstructor() ->getMock(); $soapClientMock->method('getAuthenticateServiceSettings') ->willReturn(true);
This will not work because Phpunit mockbuilder does not find the getAuthenticateServiceSettings function. This is the soap function specified in the WSDL.
However, if I extend the SoapClient class and the getAuthenticateServiceSettings method, it really works.
The problem is that I have 100 SOAP calls, all with their own parameters, etc., so I donβt want to scoff at every SOAP function and more or less recreate the entire WSDL file ...
Is there a way to mock magic methods?
soap wsdl php web-services phpunit
Patrik Grinsvall
source share