Completed
Pull Request — master (#12)
by Scott
05:10
created

JacocoLoaderTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLoadXML() 0 22 1
1
<?php
2
namespace exussum12\CoverageChecker\tests;
3
4
use PHPUnit\Framework\TestCase;
5
6
use exussum12\CoverageChecker\JacocoReport;
7
8
class JacocoLoaderTest extends TestCase
9
{
10
    public function testLoadXML()
11
    {
12
        $xmlReport = new JacocoReport(__DIR__ . '/fixtures/jacoco.xml');
13
        $coveredLines = $xmlReport->getLines();
14
        $expected = [
15
            'org/jacoco/examples/maven/java/HelloWorld.java' => [
16
                3 => true,
17
                6 => true,
18
                7 => false,
19
                9 => true,
20
            ],
21
            'org/jacoco/examples/maven/java/New/HelloWorld.java' => [
22
                3 => false,
23
                6 => false,
24
                7 => false,
25
                9 => false,
26
            ]
27
28
        ];
29
30
        $this->assertEquals($expected, $coveredLines);
31
    }
32
}
33