| Total Complexity | 5 | 
| Total Lines | 43 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 7 | class PhpMndTest extends TestCase | ||
| 8 | { | ||
| 9 | private $mnd; | ||
| 10 | |||
| 11 | public function setUp() | ||
| 12 |     { | ||
| 13 | $file = __DIR__ . '/../fixtures/phpmnd.txt'; | ||
| 14 | $this->mnd = new PhpMnd($file); | ||
| 15 | |||
| 16 | $this->assertInstanceOf(PhpMnd::class, $this->mnd); | ||
| 17 | } | ||
| 18 | |||
| 19 | public function testGetOutput() | ||
| 20 |     { | ||
| 21 | $expected = [ | ||
| 22 | 'test.php', | ||
| 23 | 'test2.php', | ||
| 24 | ]; | ||
| 25 | |||
| 26 | $this->assertSame($expected, $this->mnd->parseLines()); | ||
| 27 | } | ||
| 28 | |||
| 29 | /** | ||
| 30 | * @dataProvider fileInputs | ||
| 31 | */ | ||
| 32 | public function testLinesReturnCorrect($filename, $lineNo, $expected) | ||
| 33 |     { | ||
| 34 | $this->mnd->parseLines(); | ||
| 35 | |||
| 36 | $this->assertSame($expected, $this->mnd->getErrorsOnLine($filename, $lineNo)); | ||
| 37 | } | ||
| 38 | |||
| 39 | public function testInvalidFile() | ||
| 40 |     { | ||
| 41 | $this->assertTrue($this->mnd->handleNotFoundFile()); | ||
| 42 | } | ||
| 43 | |||
| 44 | public function fileInputs() | ||
| 50 | ]; | ||
| 51 | } | ||
| 52 | } | ||
| 53 |