getBranchFinder() public method

public getBranchFinder ( )
Ejemplo n.º 1
0
<?php

//.atoum.php
use mageekguy\atoum;
use mageekguy\atoum\reports;
$coveralls = new reports\asynchronous\coveralls('src', 'tRlttWBh45WhcNznBSaUkYeR2cVLsWzKi');
$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)->addWriter();
$runner->addReport($coveralls);
$script->addDefaultReport();
Ejemplo n.º 2
0
<?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);
    }
}
Ejemplo n.º 3
0
 public function testGetSetBranchFinder()
 {
     $this->if($report = new testedClass(uniqid(), uniqid()))->then->object($report->getBranchFinder())->isInstanceOf('\\Closure')->if($finder = function () {
     })->then->object($report->setBranchFinder($finder))->isIdenticalTo($report)->object($report->getBranchFinder())->isIdenticalTo($finder);
 }