« Previous - Version 2/5 (diff) - Next » - Current version
Sven Kiera, 01/17/2011 08:53 pm


HowTo create a Test Case Class from a PHP Class

To create a Test Case from a PHP Class follow these steps:

1. First you have to configure PHPUnit.

2. Right click on the PHP Class on PHP Explorer and select New -> PHPUnit Test Case.

[Image context menu]

If this option is missing you can also click on Other... and select PHP -> PHPUnit -> PHPUnit Test Case. To activate the shortcuts you have to reset your perspective (Window -> Reset Perspectoive...).

[Image file new dialog]

3. Now you should see the prefilled wizard page. If the target file already exists all missing test methods will be supplemented.

[Image wizard page]

phpunit_context_menu_new_test_case.png - PHPUnit context menu new Test Case (33.5 KB) Sven Kiera, 01/17/2011 08:59 pm

phpunit_file_new_other_dialog.png - PHPUnit other file dialog (24.8 KB) Sven Kiera, 01/17/2011 08:59 pm

phpunit_new_test_case_wizard.png - PHPUnit new Test Case wizard (22.4 KB) Sven Kiera, 01/17/2011 09:00 pm