Configuration¶
To configure PHPUnit follow these steps:
1. From the menu bar select Window -> Preferences
2. From the tree view of Preferences page select PHP Tools -> PHPUnit. On this page you can configure PHPUnit.
3. First select a PHP Executable for running PHPUnit
4. You can choose to use your own PEAR library or the internal. Note that the internal library is always within the include path so missing packages are used from there.
5. If you wish to print PHP output to console for debugging activate the checkbox.
6. Select your Test Case SuperClass which will be used instead of the generated from PHPUnit.
7. Define where your Test Case files should be stored. You can use the %p as project placeholder and %d[{start,end}] as directory placeholder.
Examples for file /library/myframework/subfolder1/subfolder2/filename.php:
%d = /library/myframework/subfolder1/subfolder2
%d{3} = subfolder1
%d{2,3} = myframework/subfolder1
%d{,3} = library/myframework/subfolder1
%d{2,} = myframework/subfolder1/subfolder2
8. The next field defines where the PHP Class should be stored. If you used the whole path for your Test Cases this field is optional. You can use the same placeholder as for the Test Folder Pattern (see Point 7).
9. The File Name Pattern defines the format of your Test Case filenames. Use placeholder %f for short filename or %ff for long filename without extension and %e for file extension.
Example for the file part1.part2.part3.php:
%f = part1
%ff = part1.part2.part3
%e = php
10. If you want your own bootstrap file you can select it here.
11. If you want to generate code coverage informations you can activate this checkbox. Not covered lines are marked with a information problem marker. Note that this feature needs the Xdebug PHP extension. See also HowTo change the code coverage annotations.
12. PTI checks the namespace while searching for a Test Case or PHP Class file. For example you have the \Namespace\MyClass class, PTI will search for \Namespace\MyClassTest as Test Case. If your Tests have no or different namespaces you should active this option and PTI will ignore namespaces.