https://github.com/atoum/reports-extension
atoum reports extension
https://github.com/atoum/reports-extension
atoum atoum-extension php test
Last synced: 18 days ago
JSON representation
atoum reports extension
- Host: GitHub
- URL: https://github.com/atoum/reports-extension
- Owner: atoum
- License: other
- Created: 2015-05-04T22:53:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-05T15:00:51.000Z (about 4 years ago)
- Last Synced: 2024-04-25T06:20:35.185Z (about 1 year ago)
- Topics: atoum, atoum-extension, php, test
- Language: JavaScript
- Homepage: http://atoum.github.io/reports-extension/
- Size: 3.67 MB
- Stars: 6
- Watchers: 9
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# atoum/reports-extension [](https://travis-ci.org/atoum/reports-extension) [](https://styleci.io/repos/35064717)
## Install it
Install extension using [composer](https://getcomposer.org):
```
composer require --dev atoum/reports-extension
```Enable the extension using atoum configuration file:
```php
addToRunner($runner);
```## Use it
### HTML coverage report
**Check out the demo report generated with atoum's test suite: [http://atoum.github.io/reports-extension/](http://atoum.github.io/reports-extension/)**
Add the following code to your configuration file:
```php
addDefaultReport();$coverage = new coverage\html();
$coverage->addWriter(new std\out());
$coverage->setOutPutDirectory(__DIR__ . '/coverage');
$runner->addReport($coverage);
```#### Branches and path coverage
If you want to generate branches and paths reports, you will have to install xDebug 2.3.0 or later:
```
wget https://github.com/FriendsOfPHP/pickle/releases/download/v0.4.0/pickle.phar
php pickle.phar install xdebugphp -v
```Once done, just use the `-ebpc` command line flag or add the following line of code to your configuration file:
```php
enableBranchAndPathCoverage();
```### Sonar coverage report
To add generic code coverage for sonar.
```php
$xunit = new \atoum\atoum\reports\sonar\xunit();
$writer = new \atoum\atoum\writers\file('./sonar-xunit.xml');
$xunit->addWriter($writer);
$runner->addReport($xunit);$clover = new \atoum\atoum\reports\sonar\clover();
$writer = new \atoum\atoum\writers\file('./sonar-clover.xml');
$clover->addWriter($writer);
$runner->addReport($clover);
```and add report generate to `sonar.genericcoverage` properties
## License
reports-extension is released under the BSD-3-Clause License. See the bundled [LICENSE](LICENSE) file for details.
