Browsing articles from "January, 2011"
Jan
15
15
Unit Testing your AJAX requests with Zend Framework and PHPunit
I ran into a problem yesterday, when trying to create a couple of unit tests using PHPunit along side the Zend Framework.
If you want to unit test an action in a controller that checks the request to see if is an XML HTTP Request using the isXmlHttpRequest() method provided by the Zend Framework, then you will definitely run into a problem.
isXmlHttpRequest() pretty much checks to see if the $_SERVER['HTTP_X_REQUESTED_WITH'] is set with ‘XMLHttpRequest’, if not, then returns FALSE. I thought that by setting the server variable with XMLHttpRequest directly will allow me to bypass the check.
read more
Recent Posts
Tags
add-on
Ajax
alerts
api
application
Apps
border-radius
charts
CMS
CSS
CSS3
CURL
debug
dojo
Facebook
firebug
firefox
getsimple
google
iPhone
jAlert
JavaScript
jQuery
Linux
log
messages
optimization
PHP
plug-in
programming
prototype
Resources
session
squareit
tips
tweetmeme
Ubuntu
wildfire
XML
yahoo
Zend
Zend Framework
Zend Studio
Zend_Cache
Zend_Feed