Unit testing web service based models in Zend Framework

      Comments Off on Unit testing web service based models in Zend Framework

Pascal Opitz has written another post on unit testing Zend Framework applications over at “Content with Style”:http://www.contentwithstyle.co.uk.

This time he’s writing about “unit testing web service based models”:http://www.contentwithstyle.co.uk/content/unit-testing-web-service-based-models-in-zend-framework, and suggests 3 ways of getting a successful unit test on the way: Mock objects, the Zend_HTTP test adapter, and replacing the real endpoint with a homemade one, responding with known data.

He highlights the importance of this kind of unit test in a commercial world:

bq. This exercise is a very valuable documentation of ones understanding of the service functionality at a particular point in time. Given that service APIs are often in a constant state of change, things might break in the future, but the tests we’ve written can help us understand whether it’s down to our own code or the web service instead