Practicalweb Ltd

Technical information on this site may be out of date : no updates since 2015

Install runkit for unit testing

July 24 2008 : posted under php drupal 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 co pecl/runkit
cvs co pecl/runkit

cd pecl/runkit

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

edit /et/php5/apache2/php.ini

add the line

restart apache

phpinfo() should now show

<h2><a name="module_runkit">runkit</a></h2>
    <tr class="h">
      <th>runkit support</th>
    <tr class="h">
    <tr class="h">
      <th>Custom Superglobal support</th>
    <tr class="h">
      <th>Sandbox Support</th>
      <th>disable or unavailable</th>
    <tr class="h">
      <th>Runtime Manipulation</th>

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