1 | <?php |
||
2 | namespace exussum12\CoverageChecker\tests\Loaders; |
||
3 | |||
4 | use PHPUnit\Framework\TestCase; |
||
5 | use exussum12\CoverageChecker\Loaders\PhanText; |
||
6 | |||
7 | class PhanTextTest extends TestCase |
||
8 | { |
||
9 | /** @var PhanText */ |
||
10 | protected $phan; |
||
11 | protected function setUp() |
||
12 | { |
||
13 | parent::setUp(); |
||
14 | $this->phan = new PhanText(__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)) |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
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 |