News Feed
Sections




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

TigerFish Interactive:
Drupal 6 Posting AJAX callbacks in SimpleTest
July 29, 2010 @ 11:08:07

On the TigerFish Interactive blog today there's a new post for Drupal-ers out there about using the SimpleTest plugin for Drupal 6 to run automated tests against Ajax callbacks.

In Drupal 6's excellent SimpleTest module, a method called drupalPost() allows you to simulate a button press on a form by taking the form's data and using HTTP POST to submit it. But what if you want to POST data to an AJAX callback URL? By default, SimpleTest checks which submit button you have pressed, but of course, when POSTing using AJAX, you probably won't have pressed a button!

After doing some searching on a problem he had - submitting a form without the actual form on a page - he decided the best solution was to create a base class that inherits from DrupalWebTestCase. This base class allowed him to make a POST request (via curl) to the page and simulate a form request. The code for the method is included.

0 comments voice your opinion now!
drupal ajax simpletest callback


blog comments powered by Disqus

Similar Posts

Douglas Clifton's Blog: Open-source Server-side Web Application Frameworks

Jim Plush\'s Blog: MyBic AJAX/PHP framework in top 1% of SourceForge projects in 4 days!

Zend Developer Zone: PHP Abstract Podcast Episode 16: Ajax + PHP, End to End Debugging BONUS EPISODE

Sony AK Knowledge Center: Create Realtime Chart Without Page Refresh using FusionCharts Free & Ajax

Zend Developer Zone: AJAX Chat Tutorial Part 2


Community Events

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


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

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