InfectionLoaderTest::testCanParseFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
nc 1
nop 0
dl 0
loc 24
rs 9.7998
c 0
b 0
f 0
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