PhpmndXmlDiffFilterTest::testFileNotFound()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace exussum12\CoverageChecker\tests;
3
4
use PHPUnit\Framework\TestCase;
5
use exussum12\CoverageChecker\Loaders\PhpMndXml;
6
7
class PhpmndXmlDiffFilterTest extends TestCase
8
{
9
    /** @var PhpMndXmlLoader */
0 ignored issues
show
Bug introduced by
The type exussum12\CoverageChecker\tests\PhpMndXmlLoader was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
    private $mnd;
11
12
    public function setUp()
13
    {
14
        parent::setUp();
15
        $file = __DIR__ . "/../fixtures/phpmnd.xml";
16
        $this->mnd = new PhpMndXml($file);
0 ignored issues
show
Documentation Bug introduced by
It seems like new exussum12\CoverageCh...oaders\PhpMndXml($file) of type exussum12\CoverageChecker\Loaders\PhpMndXml is incompatible with the declared type exussum12\CoverageChecker\tests\PhpMndXmlLoader of property $mnd.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
17
    }
18
19
    public function testValidFiles()
20
    {
21
        $files = $this->mnd->parseLines();
22
        $expected = [
23
            'bin/test/test.php',
24
            'bin/test/test2.php',
25
            'tests/files/test_1.php',
26
        ];
27
28
        $this->assertSame($expected, $files);
29
    }
30
31
    public function testShowsErrorOnLine()
32
    {
33
        $this->mnd->parseLines();
34
35
        $this->assertNotEmpty(
36
            $this->mnd->getErrorsOnLine('bin/test/test.php', 3)
37
        );
38
        $this->assertEmpty(
39
            $this->mnd->getErrorsOnLine('bin/test/test.php', 1)
40
        );
41
    }
42
43
    public function testFileNotFound()
44
    {
45
        $this->assertTrue($this->mnd->handleNotFoundFile());
46
    }
47
}
48