Reputation: 41080
I neet to test a couple of SOAP webservices. What types of tests can I run?
Upvotes: 5
Views: 7928
Reputation: 41080
I found http://www.versioneye.com/package/fakeweb it is
FakeWeb is a helper for faking web requests in Ruby. It works at a global level, without modifying code or writing extensive stubs.
Upvotes: 0
Reputation: 805
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
Upvotes: 8
Reputation: 401182
Testing a SOAP web-service will be quite the same than testing a "local" method : you'll have to call that method, passing it some parameters, and chechink the return value, to verify that it corresponds to the parameters you gave.
Of course, with web-services, the call will be a bit more complicated, as you'll have to work with SoapClient
to call the method, but the idea will still be the same.
The biggest problems I see are :
Upvotes: 0