mirror of
https://gh.wpcy.net/https://github.com/WordPress/WordPress-Coding-Standards.git
synced 2026-04-24 23:58:18 +08:00
... to all unit test files, as well as enable strict coverage recording.
Includes:
* PHPUnit config: add code coverage configuration.
By default, when there is a code coverage configuration and Xdebug is enabled, code coverage will be generated.
Note: generating code coverage is slow.
* Git ignore the `build` directory as created by PHPUnit to store the log files (as set up in the config file).
* Composer: add coverage script and adjust the test script.
* When running the "normal" `run-tests`, no code coverage will be created.
* To run the tests with code coverage, the new `coverage` script has been added.
When running PHPUnit locally, I'd recommend copying the `phpunit.xml.dist` file to `phpunit.xml` and replacing the `clover` logging with the following to allow for locally using the HTML report:
```xml
<log type="coverage-html" target="./build/coverage-html/"/>
```
NOte: this commit does not set up code coverage checking for PRs via an external service like Coveralls or CodeCov, though I imagine we could set this up in the future as the WP organisation already has a CodeCov account (we'd need to check if we can or need permission).
6 lines
62 B
Text
6 lines
62 B
Text
vendor/
|
|
composer.lock
|
|
build/
|
|
phpunit.xml
|
|
phpcs.xml
|
|
.phpcs.xml
|