Cover image for post A GTK2 UI for PHPUnit

A GTK2 UI for PHPUnit

For my current exam phase at university, I wanted to have some tiny project where I can play around with, without caring too much, just to relax a bit in the evenings. When Kore infected me with some strange PHP-GTK virus ;) and someone mentioned on IRC, that it would be time to have a GTK UI for PHPUnit, I decided to take this one. So I played some hours with the PHP-GTK extension and voila, here we go with a first running version of a GTK driven test runner for PHPUnit.

More screenshots can be found here

Since yesterday, the project is officially available through the PHPUnit SVN and (according to Sebastian) is planned to be part of the PHPUnit release 3.2. So far, it ist in absolute alpha stage and still misses a lot of features and might propably not run too stable on your system. At least it does on mine, so far.

By now, the GUI allows you to load single or multiple PHPUnit tests suites (starting with version 3.0 of PHPUnit), to run them and display their results. If you want to try it out, you can either check it out from the PHPUnit SVN or download a recent tarball.

To get the GTK UI running, you (of course) need a recent build of the PHP-GTK2 extension, PHP >= 5.1 and the provided "GtkUI/" directory in your PHPUnit installation. If your include_path directive is set correctly, you only need to run

$ php /your/path/to/PHPUnit/GtkUI/Main.php

I so far tried out the UI with running the eZ Components test suites, for which I need to have the eZ Components autoload in place. If you need autoloading for your test suites, too, you can simply provide a PHP file containing your __autoload() function as a parameter to the main script. Later this will propably be configurable in the UI itself, but so far:

$ php /your/path/to/PHPUnit/GtkUI/Main.php /path/to/your/autoload.php

Feel free to try it out, comment here and/or add bug-reports and feature-requests to the PHPUnit issue tracker. And, in addtition to Sebastians Logo Contest for phpOpenTracker, I'd like to beg any of you graphically skilled people out there, to send me some icons for the PHPUnit GTK2 Testrunner. Thanks in advance1


This is very cool! Now, all you need is to package this as a phar :-)

Antti Holvikari at 2007-02-20

This looks really usefull .. whats the status of this now?

dantleech at 2012-06-19