« Previous - Version 4/5 (diff) - Next » - Current version
Sven Kiera, 01/17/2011 09:04 pm


HowTo create a Test Case Class from a PHP Class

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

1. You have to configure PHPUnit first.

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

PHPUnit context menu new Test Case

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 Perspective...).

PHPUnit other file dialog

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

PHPUnit new Test Case wizard

4. Click Finish to create the Test Case.

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