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 support enabled
version 1.0.0-dev
Custom Superglobal support enabled
Sandbox Support disable or unavailable
Runtime Manipulation enabled

Now all I've got to do is use it to build some tests...

Tags

Comments

What about the pecl command?

Can't you just install with:

pecl install runkit-0.9

Comments

Maybe 0.9 works now ...

The pecl command might work now - but at the time of writing I found that installing via pecl gave me a beta version that was buggy.

If it works for you please let me know.

Thanks 

Comments

Helpful... some notes as well

From http://pecl.php.net/package/runkit:
For all those things you.... probably shouldn't have been doing anyway.... WARNING: 0.9 does not compile with PHP 5.2+ so use the CVS version instead.

So, seems CVS version is better.

Additionally, maybe it was just me, but CVS didn't seem to work. Instead I did:
svn co http://svn.php.net/repository/pecl/runkit/trunk/

Which seemed to work well.

It is slightly worrying that it has been over 2 years since 0.9 beta, but here's hoping they keep it up :)

Post new comment

Got something to add - just enter a comment
all other fields are optional.

Your email address will not be published.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.