News Feed
Sections




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

Ibuildings Blog:
Zend Framework testing emulating HTTP calls
August 29, 2008 @ 15:26:55

On the Ibuildings blog today Lorenzo Alberton takes a look at the Zend Framework, specifically as to how it can mimic regular HTTP calls with the built-in components.

One of the unit testing best practices suggests to break dependencies, so you can test each component separately. The first problem that arises when you want to test controllers might be having a tighter control over the HTTP Request and Response objects.

This problem is overcome with the Zend_Test_PHPUnit_ControllerTestCase. The second problem it with calls to external resources (like models/databases or web services). This is the prime focus of the post and seceral blocks of code are included to make a class to emulate the HTTP responses you might get back from the service.

0 comments voice your opinion now!
zendframework testing http call webservice model unittest


blog comments powered by Disqus

Similar Posts

The Bakery: Four New Articles/Components (Colors, Models, InotImg & CakeSWXPHP)

Chris Hartjes' Blog: The Story and Rebirth Of Zend_Service_Audioscrobbler, Part 2

Andrew Podner: Make it Testable-No Matter how Painful it is

PHP Thinktank Blog: Web Services with Davey

Zend Developer Zone: Mobile Platforms Built On Object-Oriented PHP 5


Community Events

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


voicesoftheelephpant library conference podcast api release symfony2 community interview configure introduction install example application series framework performance laravel php7 opinion

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