Phing Logo

Integrating Phing With PHPUnit

16th January 2009 - 2 minutes read time

PHPUnit is a unit testing framework, written in PHP, and which is used to test PHP code. You can integrate the testing that PHPUnit does into Phing. You might want to use Phing to create a nightly build that contains the latest version of your program. The last thing you want is Phing to create a nightly build that is riddled with errors.

The way around this is to use PHPUnit to test our code whilst we are running Phing. If any tests fail then Phing will not finish the build.

Create a target at the top of your build.xml file and make sure it is run first. Then add the following code to the target, This will use PHPUnit to test your code.

Apache HTTP Logo

Apache Bench Tool

25th February 2008 - 4 minutes read time

The Apache Bench tool can be found in the bin directory of any standard instillation of the Apache HTTP server. It can be used to test the response times of any web server you want and can be useful if you want to stress test a mission critical server before it goes live.

To use the tool open a command prompt (or terminal), navigate the Apache bin folder and find the program ab, this is the Apache Bench tool. The simplest form of running the tool is to use a single URL. However, you must enter a full file name or the tool will give you an invalid URL error.

ab http://www.google.com/index.html

This gives the following output.