| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function testClassCanLoad() |
||
| 10 | { |
||
| 11 | $phpmd = new PhpMd(__DIR__ . '/../fixtures/phpmd.xml'); |
||
| 12 | $lines = $phpmd->parseLines(); |
||
| 13 | $file = '/full/path/to/file/src/CoverageCheck.php'; |
||
| 14 | $expected = [$file]; |
||
| 15 | $expectedError = [ |
||
| 16 | 'The method addUnCoveredLine has a boolean flag argument ' . |
||
| 17 | '$message, which is a certain sign of a ' . |
||
| 18 | 'Single Responsibility Principle violation.' |
||
| 19 | ]; |
||
| 20 | |||
| 21 | $this->assertEquals($expected, $lines); |
||
| 22 | |||
| 23 | $this->assertEquals( |
||
| 24 | $expectedError, |
||
| 25 | $phpmd->getErrorsOnLine($file, 57) |
||
| 26 | ); |
||
| 27 | //second should respond as no errors as the first range reported it |
||
| 28 | $this->assertEquals( |
||
| 29 | [], |
||
| 30 | $phpmd->getErrorsOnLine($file, 58) |
||
| 31 | ); |
||
| 32 | |||
| 33 | $this->assertEquals( |
||
| 34 | [], |
||
| 35 | $phpmd->getErrorsOnLine($file, 10) |
||
| 36 | ); |
||
| 46 |