| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>PHP - Testing and Code Analysis</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| </head> |
| <body> |
| <h1>Testing and Code Analysis</h1> |
| <p> <img |
| src="../../images_www/v7/3/features/php/testing-top.png" |
| alt="PHP development in NetBeans IDE" class="box" border="none" |
| <br> |
| <p class="intro">When you are testing your application, the IDE provides tools for using PHPUnit, generates report of code coverage and more.</p> |
| <span id="im1" class="overview-right"><img src="/images_www/v7/3/features/php/phpunit.png"></span> |
| <h2>PHP Unit Testing</h2> |
| <p>Create <a href="http://www.phpunit.de/manual/current/en/">PHPUnit</a> tests and Selenium test cases for |
| files or folders, run tests, and view test results. You can define test groups to selectively run unit test upon. In the PHPUnit properties |
| you can define a custom XML configuration file, a bootstrap file for command line options, or a custom test suite, or project-specific |
| PHPUnit script. You can let the IDE generate skeleton code for you using |
| <a href="http://www.phpunit.de/manual/current/en/skeleton-generator.html">PHPUnit Skeleton Generator</a>. Use a keyboard shortcut |
| to navigate quickly between test and tested class.<br> |
| <a href="http://netbeans.org/kb/docs/php/phpunit.html">Testing with PHPUnit and Selenium</a></p> |
| <div class="line"> </div> |
| <span class="overview-left" id="im2"><img src="/images_www/v7/3/features/php/php-code-coverage.png"></span> |
| <h2>Code Coverage</h2> |
| <p>Generate a Code Coverage report for PHP files to see how well your test cases cover your code: |
| Covered statements are marked green in the editor, statements that haven't been executed during the test are marked red. |
| The evaluation is based on the number of executable statements, lines with white space and comments do not distort the result.</p> |
| <div class="line"> </div> |
| <span id="im3" class="overview-right"><img src="/images_www/v7/3/features/ide-collaboration-hudson-cut.png"></span> |
| <h2>Continuous Integration Support</h2> |
| <p>NetBeans IDE supports continuous integration. Continuous integration is a software development |
| practice involving version control and a specialized server. The specialized server runs scheduled PHPUnit and Code Coverage tests |
| on the software. Test results are associated with version control information, so developers can identify bugs they introduce to |
| the software quickly and easily. NetBeans uses <a href="http://jenkins-php.org/">Template for Jenkins Jobs for PHP Projects</a>, |
| which must be set up with the necessary plugins and tools on the integration server.</p> |
| <div class="line"> </div> |
| |
| <h2>See Also</h2> |
| <ul class="bigger"> |
| <li><a href="/community/releases/81/index.html">NetBeans IDE 8.1 Release Page</a> for a list of specific features in the latest stable release.</li> |
| <li><a href="../../kb/trails/php.html">PHP and HTML5 Learning Trail</a> for tutorials that will help you get started.</li> |
| </ul> |
| |
| </body> |
| </html> |