InfectionLoaderTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanParseFile() 0 24 1
A testFileNotFound() 0 4 1
1
<?php
2
namespace exussum12\CoverageChecker\tests\Loaders;
3
4
use PHPUnit\Framework\TestCase;
5
use exussum12\CoverageChecker\Loaders\Infection;
6
7
class InfectionLoaderTest extends TestCase
8
{
9
10
    public function testCanParseFile()
11
    {
12
13
        $infection = new Infection(__DIR__ . '/../fixtures/infection-log.txt');
14
        $files = $infection->parseLines();
15
16
        $file = '/home/scott/code/coverageChecker/src/DiffFilter.php';
17
18
        $this->assertFalse(
19
            (bool)$infection->getErrorsOnLine(
20
                $file,
21
                20
22
            )
23
        );
24
        $this->assertTrue(
25
            (bool)$infection->getErrorsOnLine(
26
                $file,
27
                21
28
            )
29
        );
30
31
        $this->assertSame(
32
            array_values($files),
33
            $files
34
        );
35
    }
36
37
    public function testFileNotFound()
38
    {
39
        $infection = new Infection(__DIR__ . '/../fixtures/infection-log.txt');
40
        $this->assertTrue($infection->handleNotFoundFile());
41
    }
42
}
43