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