I neet to test a couple of SOAP webservices. What types of tests can I run?
It is by far better to test the local consumer classes with mocks of the SoapClient that return pre-recorded result XML, since Unit-Tests are meant to run fast and be independant from remote services.
$this->returnValue()
to return pre-recorded XML responses or headers that your system expectsSee: http://www.phpunit.de/manual/current/en/test-doubles.html
If your system is dependant on the availability of those remote services, you could implement a watchdog service that checks if the ressource is available, but this is not something that should be done in the Unit-Tests themselves.
Kind regards, Thomas
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With