SimpleTest

Setting up a unit testing tool
Eclipse/PHP supports two major unit testing tools: SimpleTest and PHPUnit. Either one provides good unit testing support. The following description shows how to set up Eclipse/PHP for running SimpleTest unit tests.

Download and install the SimpleTest Eclipse plug-in

 * Select Help->Install New Software
 * Click Add... and Add Repository dialog window pops-up.
 * Type simpletest in the Name field and the URL  http://simpletest.org/eclipse/  in the Location field. Click OK.
 * The Available Software dialog box of the Install procedure lists the SimpleTest plug in the Name/Version text area. Select the checkbox by its name and click Next.
 * The installed items are shown in the Install Details view. Click Next, accept the license agreements, and you're done.

Installation process starts. When done, you're prompted to restart Eclipse.

To test your installation:
 * Go to the eclipse/plugins directory
 * Look for net.sf.simpletest.eclipse_0.2.5 subdirectory
 * Examine its contents.
 * You should find simpletest_php directory with a bunch of PHP scripts, including eclipse.php.
 * If you don't find this directory, then you need to unzip simpletest_php.zip. It will produce the missing directory.

Configure SimpleTest to run inside Eclipse

 * Select Window -> Preferences -> SimpleTest
 * Fill the text fields by browsing to:
 * PHP executable file (php.exe)
 * php.ini file
 * SimpleTest plug-in path within your eclipse directory structure. NOTE: you have to navigate to the eclipse/plugins/net.sf.simpletest.eclipse_0.2.5/simpletest_php directory.
 * Enter php for the Test File Suffix text field.



Configure SimpleTest running on a unit test file
A new running configuration appears under SimpleTest in the left pane.
 * Pick a unit test file from the tests directory of the rmh15 project in the PHP Explorer view. (I used AllTests.php)
 * Right-click on the file and choose Run -> Run Configurations...
 * Select SimpleTest from the list on the left pane
 * Click the New button at the top of the left pane (it has a little yellow + sign on it).
 * A Create, manage, and run configurations dialog box opens.
 * In the Name field, enter a name for this unit test run configuration. Good practice is to name it with the name of the file, E.G., AllTests.php
 * For the Project field, browse to the rmh15 project.
 * For the Test file field, browse to the unit test file for which you use SimpleTest. (should be the same filename that you named earlier)
 * Click Apply

Run a unit test suite
To run the rmh15 unit test suite any time, exercise this new run configuration: Select -> tests Right-click AllTests.php Select Run As -> SimpleTest Alternatively, you can run this by returning to Run -> Run Configurations, selecting your new rmh15AllTests configuration, and hitting Run at the bottom of the form. A Result View should now appear.

Rerun a unit test suite
The test suite run can be repeated by itself any time you want to rerun the AllTests.php script. You only need to make a run configuration for it on the first run. If you want to repeat this run right away, you may need to select Revert before hitting Run again. For more detailed and tutorial information on defining unit tests and running SimpleTest, see http://simpletest.org/en/overview.html.

Installing RMH System
Categories:Temp