News Feed
Sections




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

Chris Hartjes' Blog:
Testing Form Posts in Zend Framework
September 23, 2010 @ 10:36:42

In a new post to his blog today Chris Hartjes talks about the trials and tribulations he had when trying to test POST requests in his Zend Framework application with Zend_Test/PHPUnit.

I had done a refactoring of the way a model was pulling in stats for running backs and receivers for a fantasy game. As a result, in production (you suck Chris) you could not see results for those players. The data was there, I had not properly tested things. A familiar situation. So, I fixed the code and wrote my more-specific-than-before unit tests, but I decided I also wanted to make sure that the output on the page itself worked correctly. This began the descent into madness.

He found several examples of ways to test POST requests but none of them worked in his situation. They used an object chaining method that just didn't cooperate for him, so he figured out another way. The code for it's included in the post - it uses the getRequest method to set up and send the POST request.

0 comments voice your opinion now!
zendframework post request getrequest unittest zendtest phpunit


blog comments powered by Disqus

Similar Posts

Matthew Weier O'Phinney's Blog: Autocompletion with Zend Framework and Dojo

Robert Basic's Blog: Debugging Zend Framework unit tests with Xdebug and NetBeans

Nick Halstead's Blog: Zend Framework RC1 and Zend ACL usage

Zend Developer Zone: Zend Framework 1.0.0 RC1 released

Sebastian Bergmann\'s Blog: PHPUnit Talk at PHP Usergroup Dortmund


Community Events

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


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

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