1 | <?php |
||
2 | namespace exussum12\CoverageChecker\tests\Loaders; |
||
3 | |||
4 | use PHPUnit\Framework\TestCase; |
||
5 | use exussum12\CoverageChecker\Loaders\Clover; |
||
6 | |||
7 | class LoadCloverReportTest extends TestCase |
||
8 | { |
||
9 | public function testLoadXML() |
||
10 | { |
||
11 | $xmlReport = new Clover(__DIR__ . '/../fixtures/coverage.xml'); |
||
12 | $coveredLines = $xmlReport->parseLines(); |
||
13 | $expected = [ |
||
14 | '/path/to/file/changedFile.php', |
||
15 | '/path/to/file/otherFile.php', |
||
16 | ]; |
||
17 | $this->assertEquals($expected, $coveredLines); |
||
18 | |||
19 | $this->assertEquals( |
||
20 | ['No unit test covering this line'], |
||
21 | $xmlReport->getErrorsOnLine('/path/to/file/changedFile.php', 14) |
||
22 | ); |
||
23 | |||
24 | $this->assertEquals( |
||
25 | [], |
||
26 | $xmlReport->getErrorsOnLine('/path/to/file/changedFile.php', 10) |
||
27 | ); |
||
28 | //True as the report doesnt contain the file |
||
29 | $this->assertNull($xmlReport->getErrorsOnLine('/path/to/file/NonExistantFile.php', 6)); |
||
30 | } |
||
31 | |||
32 | public function testCorrectMissingFile() |
||
33 | { |
||
34 | $xmlReport = new Clover(__DIR__ . '/fixtures/coverage.xml'); |
||
35 | |||
36 | $this->assertNull($xmlReport->handleNotFoundFile()); |
||
0 ignored issues
–
show
|
|||
37 | } |
||
38 | } |
||
39 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.