HowTo run a Test Case

To run a PHPUnit Test Case you have the following options:

Option 1: Click on Run selected PHPUnit Test from the PHPUnit toolbar. This checked the active file from the editor or PHP Explorer if it is a PHPUnit Test Case. If yes, it will be executed. If it is not a PHPUnit Test Case it search for the related Test Case executed it.

Run PHPUnit Test from toolbar

Option 2: Right click on the file on PHP Explorer and select PHP Tools -> PHPUnit -> Run PHPUnit Test. This checked the chosen file if it is a PHPUnit Test Case. If yes, it will be executed. If it is not a PHPUnit Test Case it search for the related Test Case executed it.

Run PHPUnit Test from context menu

To open the result view select Window -> Show View -> PHPUnit. If you don't see the PHPUnit view option you can otherwise select Window -> Show View -> Other... and than choose PHP Tools -> PHPUnit or you can reset your perspective (Window -> Reset Perspective...) to activate the shortcut.

PHPUnit Result View

If you like you can assign a shortcut for this action. Select Window -> Preferences and open General -> Keys. Add phpunit to filter all commands.

PHPUnit run test shortcut

phpunit_toolbar_run_test.png - Run PHPUnit Test from toolbar (4.8 KB) Sven Kiera, 01/17/2011 09:22 pm

phpunit_context_menu_run_test.png - Run PHPUnit Test from context menu (52 KB) Sven Kiera, 01/17/2011 09:22 pm

phpunit_shortcut_run_test.png - PHPUnit run test shortcut (50.5 KB) Sven Kiera, 01/17/2011 09:29 pm

phpunit_result_view.png - PHPUnit Result View (21.7 KB) Sven Kiera, 01/18/2011 11:17 am