Category: Unit Testing

KissTest, a Simple, Fast, and Beautiful Unit Test Framework for PHP

PHPUnit is a great testing framework. However, over time I began to find myself wishing it had certain features. So I created KissTest. It is a Keep-It-Simple-Straightforward (KISS), very fast, and absolutely gorgeous xUnit style unit test library.

kisstest-tests-passAs you can see in the screenshot, the display of the results is right in the browser. Everyone loves the command line and I am no different. However, there is something to be said for seeing the results laid out beautifully like this. Also, the PHP CLI binary is technically different from the one that is used to serve web pages. Generally, I try to keep the execution environment for the development environment and the production environment as close as possible. In fact, my development environment is identical to the production environment except it is running in VirtualBox. KissTest facilitates this. Sweet!

Read more…

Quick and Dirty PHP Test Driven Development

A long time ago, a unit testing framework for PHP was needed. At the time, there were many preexisting and comprehensive unit testing frameworks. However, a framework was needed that had the ability to run the tests from a browser. Additionally, a framework was required that would easy to integrate into a project while not increasing the footprint too much.

To satisfy these constraints, a PHP unit testing framework called QnDPhpUnitTest was written (UPDATE: This has been superseded by KissTest). Interestingly, the framework and the project that the framework was originally written for were created simultaneously. When an assert was needed, the assert method was written and then the assert was performed. One of the key benefits of this framework is the ability to include a single class and then start writing tests. Also, the framework is so simple that learning how to use it should take no more than a 5-10 minutes.