Skip to content

Commit 611817f

Browse files
committed
Add missing line and refactor
1 parent 05033fc commit 611817f

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

tests/PhpmndXmlDiffFilterTest.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@
66

77
class PhpmndXmlDiffFilterTest extends TestCase
88
{
9+
/** @var PhpMndXmlLoader */
10+
private $mnd;
911

10-
public function testValidFiles()
12+
public function setUp()
1113
{
14+
parent::setUp();
1215
$file = __DIR__ . "/fixtures/phpmnd.xml";
13-
$mnd = new PhpMndXmlLoader($file);
14-
$files = $mnd->parseLines();
16+
$this->mnd = new PhpMndXmlLoader($file);
17+
}
18+
19+
public function testValidFiles()
20+
{
21+
$files = $this->mnd->parseLines();
1522
$expected = [
1623
'bin/test/test.php',
1724
'bin/test/test2.php',
@@ -23,15 +30,18 @@ public function testValidFiles()
2330

2431
public function testShowsErrorOnLine()
2532
{
26-
$file = __DIR__ . "/fixtures/phpmnd.xml";
27-
$mnd = new PhpMndXmlLoader($file);
28-
$mnd->parseLines();
33+
$this->mnd->parseLines();
2934

3035
$this->assertNotEmpty(
31-
$mnd->getErrorsOnLine('bin/test/test.php', 3)
36+
$this->mnd->getErrorsOnLine('bin/test/test.php', 3)
3237
);
3338
$this->assertEmpty(
34-
$mnd->getErrorsOnLine('bin/test/test.php', 1)
39+
$this->mnd->getErrorsOnLine('bin/test/test.php', 1)
3540
);
3641
}
42+
43+
public function testFileNotFound()
44+
{
45+
$this->assertTrue($this->mnd->handleNotFoundFile());
46+
}
3747
}

0 commit comments

Comments
 (0)