Manual:PHP unit testing/Code coverage

This manual explains how to generate code coverage on your local workstation. This can be useful to understand how coverage works and to see progress on your work before submitting your change to Gerrit.

Ensure you have: Run the following script:
 * PHPUnit installed.
 * Xdebug installed.

Coverage scope
When running PHPUnit on a subset of files or sub directory, the tests are much quicker. However, building the coverage report may still take a long time.

By changing filter whitelist in  to match the scope of your test run, you can generate coverage reports much faster.

For example:

MediaWiki-Vagrant
You can view the coverage report at http://localhost:8080/w/tests/coverage/.