-
Notifications
You must be signed in to change notification settings - Fork 0
/
.atoum.php
43 lines (32 loc) · 894 Bytes
/
.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
40
41
42
43
<?php
use mageekguy\atoum\reports;
$runner
->addTestsFromDirectory(__DIR__ . '/tests/units/classes')
->disallowUsageOfUndefinedMethodInMock()
;
$runner->getScore()->getCoverage()->excludeDirectory(__DIR__ . '/tests/units/mock');
$travis = getenv('TRAVIS');
if ($travis)
{
$script->addDefaultReport();
$coverallsToken = getenv('COVERALLS_REPO_TOKEN');
if ($coverallsToken)
{
$coverallsReport = new reports\asynchronous\coveralls('classes', $coverallsToken);
$defaultFinder = $coverallsReport->getBranchFinder();
$coverallsReport
->setBranchFinder(function() use ($defaultFinder) {
if (($branch = getenv('TRAVIS_BRANCH')) === false)
{
$branch = $defaultFinder();
}
return $branch;
}
)
->setServiceName('travis-ci')
->setServiceJobId(getenv('TRAVIS_JOB_ID'))
->addDefaultWriter()
;
$runner->addReport($coverallsReport);
}
}