Browsing articles tagged with " Ajax"

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


5 Things: Working with Zend Framework and Ajax

Today I wanted to write about 5 awesome Zend Framework components/helpers that can help you when working with ajax.


This handy little method can eliminate the need to send extra parameters such as /ajax/true/ to let the controller know it’s an Ajax request. read more