News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Content With Style:
Unit testing web service based models in Zend Framework
April 29, 2009 @ 08:44:44

The Content with Style blog has continued their series looking at unit testing with the Zend Framework (see this previous post) with this look at testing services based models.

However, unit testing models that talk to web services presents us with a different set of problem. Usually our application runs requests against something that is not in our control. Unless the service provider gives us some kind of test mode, we're operating with dynamic live data which shouldn't be used for testing, since it's harder to test in the first place, but also could be harmful to be manipulated.

They present two method you can use to test the models: creating mock objects to handle and return correctly formatted data and intercepting the HTTP request to either send it to a Zend_HTTP adapter or a different endpoint (service location).

0 comments voice your opinion now!
unittest webservice model zendframework mock object endpoint http


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Zend Framework Traveling Roadshow Coming to SF PHP Meetup

Gergely Hodicska's Blog: Extending Zend_Acl to support custom roles and resources

Matthew Weier O'Phinney's Blog: Setting up your Zend_Test test suites

Community News: PHPBenelux BugHuntDay 2010 (Zend Framework & Joind.in)

Rob Allen's Blog: File uploads with Zend_Form_Element_File


Community Events





Don't see your event here?
Let us know!


community developer introduction homestead configure series application api language release library install code laravel podcast wordpress unittest interview list threedevsandamaybe

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework