We are going to:
Please consider...
The first framework I saw after a little googling, was the phpUnit (PEAR) framework - it was positioned as the one and the best framework for performing tests in PHP (according to google results). The installation instructions were relatively complicated, involving some PEAR command line installations, and some configuration modifications. That seemed too complicated for just runnung a few tests for my applications. Ofcourse I've installed in and run some tests, (by the way, the code was relatively clear and simple) but I did not like running the tests from the command line. Once you are on a shared hosting or some server with no access to the command line, you have a problem.
After seeking for a convenient unit testing method and its simplest implementations in PHP, I've noticed phpRack testing framework. The first thing I saw was the simplicity in installing and using (ofcourse after browsing their website). Some very simple tutorials and examples convinced me to try it.
The step-by-step instructions were perfect. lead me to run my tests in a few minutes. So here they are with a little explanation:
<?php // this param is mandatory, others are optional $phpRackConfig = array( 'dir' => 'rack-tests', ); // absolute path to the bootstrap script on your server include '../phpRack/bootstrap.php';
<?php // the name of the file should be also mytest.php class MyTest extends phpRack_Test { public function testPhpVersionIsCorrect() { $this->assert->success('this is the success mess; } }
For conclusion, there are much more available assert functions except fail and success, you can see it the full assertions list on their site.
I liked the library, and hope to use it in the future.
Enjoy you too,
Greg.