Testing the SOAP web service will be exactly the same as testing the βlocalβ method: you will have to call this method, pass it some parameters and chechink the return value to make sure that it matches the parameters you gave.
Of course, using web services, the call will be a little more complicated, since you have to work with SoapClient to call the method, but the idea will still be the same.
The biggest problems that I see are the following:
- Web service calls are slow (they go over the network), which means your tests will take time to complete, which means you wonβt be able to run them as often
- With a web service, you could potentially have more than one possible reason for the failure; which means you will have more problems figuring out why the test failed:
- This may be unsuccessful because there is a mistake - which is an ideal case
- But it can also fail because the remote server is down.
- Or due to network unavailability
- And probably some other possible reasons.
- Of course, since the code will be executed on a remote server, and not on the machine running PHPUnit, it will be much more difficult to get code coverage (for example)
source share