Test Failed
Pull Request — master (#132)
by Alessandro
03:15
created

CoverageResultTest::testGenerateResults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Unit\Coverage;
6
7
use Paraunit\Coverage\CoverageMerger;
8
use Paraunit\Coverage\CoverageResult;
9
use Paraunit\Coverage\Processor\CoverageProcessorInterface;
10
use Prophecy\Argument;
11
use Tests\BaseTestCase;
12
13
/**
14
 * Class CoverageResultTest
15
 * @package Tests\Unit\Coverage
16
 */
17
class CoverageResultTest extends BaseTestCase
18
{
19
    public function testGenerateResults()
20
    {
21
        $merger = $this->prophesize(CoverageMerger::class);
22
        $merger->getCoverageData()
23
            ->willReturn($this->createCodeCoverage());
24
25
        $coverageResult = new CoverageResult($merger->reveal());
26
27
        $coverageResult->addCoverageProcessor($this->mockCoverageProcessorInterface());
28
        $coverageResult->addCoverageProcessor($this->mockCoverageProcessorInterface());
29
        $coverageResult->addCoverageProcessor($this->mockCoverageProcessorInterface());
30
31
        $coverageResult->generateResults();
32
    }
33
34
    private function mockCoverageProcessorInterface(): CoverageProcessorInterface
35
    {
36
        $coverageProcessor = $this->prophesize(CoverageProcessorInterface::class);
37
        $coverageProcessor->process(Argument::cetera())
38
            ->shouldBeCalledTimes(1);
39
40
        return $coverageProcessor->reveal();
41
    }
42
}
43