Objetive
Provides Unit test to Drupal Modules unsing PHPUnit. This modules provides a custom
runner to run PHPUnit test in Drupal. Also include some features to mock functions using the test_helper extension created
by Sebastian Bergman.
Actually is tested in Drupal 6 only, we will include support for Drupal 7 also in the future.
Instalation
Previous to the module instalation you need to have installed PHPUnit, Xdebug and Test_Helpers
extension.
In order to install PHPUnit do the following steps
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear upgrade PEAR
pear install phpunit/PHPUnit
Install Xdebug in Debian (or debians likes).
apt-get install php5-xdebug
Install Test Helpers
pecl install phpunit/test_helpers
At the end include the extension in your php.ini
zend_extension=/path_to_the_extension/test_helpers.so
Test if the extension was loaded
$php --info|grep "test_helpers support"
test_helpers support => enabled
Once you have all that installed you can proceed with the instalation of this module as
any drupal module.
Copy the module in some reacheable location by your drupal site.
drush en phpunit2 -y