Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
chore: add coveralls.io support
Browse files Browse the repository at this point in the history
  • Loading branch information
RETFU committed Mar 9, 2016
1 parent 3b35d7d commit ccc3d21
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
31 changes: 22 additions & 9 deletions .atoum.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
<?php

use \mageekguy\atoum;
use mageekguy\atoum\reports;

$report = $script->addDefaultReport();
$runner->addTestsFromDirectory('tests/units');

// fun
// $report->addField(new atoum\report\fields\runner\atoum\logo());
// $report->addField(new atoum\report\fields\runner\result\logo());
//coveralls.io only from travis-ci
if(getenv('TRAVIS')) {
$coveralls = new reports\asynchronous\coveralls('src', 'JbFBPr0Mz22rU3mCsvQhfs0ruvMzldcrk');
$defaultFinder = $coveralls->getBranchFinder();
$coveralls
->setBranchFinder(function() use ($defaultFinder) {
if (($branch = getenv('TRAVIS_BRANCH')) === false)
{
$branch = $defaultFinder();
}

// error
// $coverageField = new atoum\report\fields\runner\coverage\html('RREST', 'coverage');
// $coverageField->setRootUrl('https://github.com/RETFU/RREST');
// $report->addField($coverageField);
return $branch;
})
->setServiceName(getenv('TRAVIS') ? 'travis-ci' : null)
->setServiceJobId(getenv('TRAVIS_JOB_ID') ?: null)
->addDefaultWriter()
;
$runner->addReport($coveralls);
}

$runner->addTestsFromDirectory('tests/units');

$report = $script->addDefaultReport();
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**RREST** build good REST API in PHP.

[![Build Status](https://api.travis-ci.org/RETFU/RREST.svg?branch=master)](https://travis-ci.org/RETFU/RREST)
[![Coverage Status](https://coveralls.io/repos/github/RETFU/RREST/badge.svg?branch=master)](https://coveralls.io/github/RETFU/RREST?branch=master)
![WIP](https://img.shields.io/badge/unstable-master-red.svg)

> Important: **RREST** is in active development. The API is not frozen and BC break can happen at any time.
Expand Down

0 comments on commit ccc3d21

Please sign in to comment.