forked from RETFU/RREST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.atoum.php
39 lines (31 loc) · 1.14 KB
/
.atoum.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
use \mageekguy\atoum;
use mageekguy\atoum\reports;
use mageekguy\atoum\reports\coverage;
use mageekguy\atoum\writers\std;
$extension = new reports\extension($script);
$extension->addToRunner($runner);
$runner->addTestsFromDirectory('tests/units');
//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();
}
return $branch;
})
->setServiceName(getenv('TRAVIS') ? 'travis-ci' : null)
->setServiceJobId(getenv('TRAVIS_JOB_ID') ?: null)
->addDefaultWriter()
;
$runner->addReport($coveralls);
}
$report = $script->addDefaultReport();
$coverage = new coverage\html();
$coverage->addWriter(new std\out());
$coverage->setOutPutDirectory(__DIR__ . '/coverage');
$runner->addReport($coverage);