| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function testLoadXML() |
||
| 11 | { |
||
| 12 | $xmlReport = new XMLReport(__DIR__ . '/fixtures/coverage.xml'); |
||
| 13 | $coveredLines = $xmlReport->getLines(); |
||
| 14 | $expected = [ |
||
| 15 | '/path/to/file/changedFile.php' => [ |
||
| 16 | 10 => 4, |
||
| 17 | 11 => 4, |
||
| 18 | 14 => 0, |
||
| 19 | 15 => 3, |
||
| 20 | 18 => 3, |
||
| 21 | 19 => 3, |
||
| 22 | 22 => 3, |
||
| 23 | ], |
||
| 24 | '/path/to/file/otherFile.php' => [ |
||
| 25 | 9 => 4, |
||
| 26 | 10 => 4, |
||
| 27 | ], |
||
| 28 | ]; |
||
| 29 | $this->assertEquals($expected, $coveredLines); |
||
| 30 | $this->assertFalse($xmlReport->isValidLine('/path/to/file/changedFile.php', 14)); |
||
| 31 | $this->assertTrue($xmlReport->isValidLine('/path/to/file/changedFile.php', 10)); |
||
| 32 | //True as the report doesnt contain the file |
||
| 33 | $this->assertTrue($xmlReport->isValidLine('/path/to/file/NonExistantFile.php', 6)); |
||
| 34 | } |
||
| 35 | |||
| 43 |