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

CoverageResultTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGenerateResults() 0 14 1
A mockCoverageProcessorInterface() 0 8 1
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