Skip to content

Commit 6aa3b3e

Browse files
jrfnlgrogy
authored andcommitted
Tests: use the PL_TESTROOT constant
... as declared in the test bootstrap file to allow for more stability when test files get moved around.
1 parent 4470fd2 commit 6aa3b3e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/ParallelLintLintTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testNotExistsFile()
6060
public function testEmptyFile()
6161
{
6262
$parallelLint = new ParallelLint($this->getPhpExecutable());
63-
$result = $parallelLint->lint(array(__DIR__ . '/fixtures/fixture-01/empty-file'));
63+
$result = $parallelLint->lint(array(PL_TESTROOT . '/fixtures/fixture-01/empty-file'));
6464

6565
$this->assertSame(1, $result->getCheckedFilesCount());
6666
$this->assertSame(0, $result->getFilesWithSyntaxErrorCount());
@@ -71,7 +71,7 @@ public function testEmptyFile()
7171
public function testValidFile()
7272
{
7373
$parallelLint = new ParallelLint($this->getPhpExecutable());
74-
$result = $parallelLint->lint(array(__DIR__ . '/fixtures/fixture-02/example.php'));
74+
$result = $parallelLint->lint(array(PL_TESTROOT . '/fixtures/fixture-02/example.php'));
7575

7676
$this->assertSame(1, $result->getCheckedFilesCount());
7777
$this->assertSame(0, $result->getFilesWithSyntaxErrorCount());
@@ -81,7 +81,7 @@ public function testValidFile()
8181
public function testInvalidFile()
8282
{
8383
$parallelLint = new ParallelLint($this->getPhpExecutable());
84-
$result = $parallelLint->lint(array(__DIR__ . '/fixtures/fixture-03/example.php'));
84+
$result = $parallelLint->lint(array(PL_TESTROOT . '/fixtures/fixture-03/example.php'));
8585

8686
$this->assertSame(1, $result->getCheckedFilesCount());
8787
$this->assertSame(1, $result->getFilesWithSyntaxErrorCount());
@@ -92,7 +92,7 @@ public function testInvalidFile()
9292
public function testDeprecated()
9393
{
9494
$parallelLint = new ParallelLint($this->getPhpExecutable());
95-
$result = $parallelLint->lint(array(__DIR__ . '/fixtures/fixture-05/Foo.php'));
95+
$result = $parallelLint->lint(array(PL_TESTROOT . '/fixtures/fixture-05/Foo.php'));
9696
$this->assertSame(1, $result->getCheckedFilesCount());
9797
$this->assertSame(0, $result->getFilesWithSyntaxErrorCount());
9898
$this->assertFalse($result->hasSyntaxError());
@@ -104,7 +104,7 @@ public function testDeprecated()
104104

105105
$parallelLint = new ParallelLint($this->getPhpExecutable());
106106
$parallelLint->setShowDeprecated(true);
107-
$result = $parallelLint->lint(array(__DIR__ . '/fixtures/fixture-05/Foo.php'));
107+
$result = $parallelLint->lint(array(PL_TESTROOT . '/fixtures/fixture-05/Foo.php'));
108108
$this->assertSame(1, $result->getCheckedFilesCount());
109109
$this->assertSame(1, $result->getFilesWithSyntaxErrorCount());
110110
$this->assertTrue($result->hasSyntaxError());
@@ -115,8 +115,8 @@ public function testValidAndInvalidFiles()
115115
{
116116
$parallelLint = new ParallelLint($this->getPhpExecutable());
117117
$result = $parallelLint->lint(array(
118-
__DIR__ . '/fixtures/fixture-02/example.php',
119-
__DIR__ . '/fixtures/fixture-03/example.php',
118+
PL_TESTROOT . '/fixtures/fixture-02/example.php',
119+
PL_TESTROOT . '/fixtures/fixture-03/example.php',
120120
));
121121

122122
$this->assertSame(2, $result->getCheckedFilesCount());

tests/SkipLintProcessTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class SkipLintProcessTest extends UnitTestCase
1111
public function testLargeInput()
1212
{
1313
$filesToCheck = array(
14-
__DIR__ . '/fixtures/skip-on-5.3/class.php',
15-
__DIR__ . '/fixtures/skip-on-5.3/trait.php',
14+
PL_TESTROOT . '/fixtures/skip-on-5.3/class.php',
15+
PL_TESTROOT . '/fixtures/skip-on-5.3/trait.php',
1616
);
1717

1818
for ($i = 0; $i < 15; $i++) {

0 commit comments

Comments
 (0)