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

JacocoLoaderTest::testLoadXML()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 0
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
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