PracticalWeb Ltd

Websites that work for you.

Install Runkit for Unit Testing

Unit testing Drupal can be pretty challenging as it’s hard to isolate parts of the code.

It seems :

that runkit together with Drupal’s implementation of SimpleTest is the way to go..

I found it a bit tricky to install on Linux (Ubuntu)

Some windows installers seem to have it built in but for those of us who like our dev and live environments to be similar:

Download runkit from cvs (I found the beta version to have bugs)

sudo aptitude install php-pear sudo aptitude install php5-dev

mkdir temp cd temp

cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/runkit cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/runkit

cd pecl/runkit phpize ./configure make

sudo  cp /home/sean/temp/pecl/runkit/modules/runkit.so /usr/lib/php5/20060613+lfs/

edit /et/php5/apache2/php.ini

add the line

extension=runkit.so

restart apache 

 

phpinfo() should now show

 

runkit

runkit supportenabled
version1.0.0-dev
Custom Superglobal supportenabled
Sandbox Supportdisable or unavailable
Runtime Manipulationenabled

Now all I’ve got to do is use it to build some tests…

Comments