Completed
Push — master ( 4da4bd...5ab290 )
by Scott
14s
created

PhanTextTest::testOutput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 9

Duplication

Lines 17
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 17
loc 17
rs 9.4285
c 1
b 0
f 0
1
<?php
2
namespace exussum12\CoverageChecker\tests;
3
4
use PHPUnit\Framework\TestCase;
5
use exussum12\CoverageChecker\PhanTextLoader;
6
7 View Code Duplication
class PhanTextTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /** @var  PhanTextLoader */
10
    protected $phan;
11
    protected function setUp()
12
    {
13
        parent::setUp();
14
        $this->phan = new PhanTextLoader(__DIR__ . '/fixtures/phan.txt');
15
    }
16
17
    public function testOutput()
18
    {
19
        $file1 = 'src/ArgParser.php';
20
21
        $lines = $this->phan->parseLines();
22
23
        $this->assertCount(2, $lines);
24
25
        $this->assertContains(
26
            'Argument 1 (string) is int but \strlen() takes string',
27
            current($this->phan->getErrorsOnLine($file1, 35))
28
        );
29
        $this->assertEquals(
30
            [],
31
            $this->phan->getErrorsOnLine($file1, 30)
32
        );
33
    }
34
35
    public function testNotFoundFile()
36
    {
37
        $this->assertTrue($this->phan->handleNotFoundFile());
38
    }
39
}
40