Introducing Unit Testing for the Seminar Manager
While working on the Seminar Manager since many months (see impressive statistics *smile*), I've learned much about PHP, Software development and all the processes behind successful and stressfree development.
A few days ago (ok, 1-2 months), Oliver Klee and I together with the others that work on the Seminar Manager decided to add unit tests at least to all the newly written or refactored code.
As I already tried that long time ago and ran into troubles with PHPUnit, PEAR and the t3unit extension for TYPO3, I was curious about what happened and improved since then. And oh wonder: There's a new extension for TYPO3, written by Kasper Ligaard from Denmark! This is the output in the Backend of my TYPO3 development installation (running all the tests for tx_seminars):
The extension is extending the PHPUnit Framework and the integration in TYPO3 is based on the initial work of Robert Lemke that wrote the t3unit extension. Kasper's extension "phpunit" which is available from TER contains some cool features:
- Has the PHPUnit stuff included, but allows to specify a folder that contains another version of PHPUnit if you need that
- Nice output of the tests with color coded states for each test
- Allows you to have a separate folder with tests and fixtures for foreign languages. So you can run tests for TYPO3 extensions that don't have their own tests included.
I can recommend unit testing in general, and the phpunit extension for TYPO3 in special to everyone that writes extensions for TYPO3! We've found some bugs in older code that we've thought is working - but the tests showed that there were some issues in the code (that we wouldn't have found without the tests).
Thanks Kasper for that great extension!




Sonntag, 11-11-07 14:06
Hello,
it's really cool to see, that the effort of ECT to make PEAR available for TYPO3 and to make unit testing a more widespread standard for T3 extensions has first fruits. I encourage people to follow this example. Kasper Ligaard did a big job to improve Roberts extension.
Inspired by his extension I did a port for the PHP world outside T3 to work on some more bridging between T3 and libraries available on different PEAR channels:
http://cool.sourceforge.net/
Elmar
Head of extension coordinal team (2007)