Skip to content

Commit

Permalink
Merge pull request #7355 from wouterj/fix-test-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Jan 9, 2022
2 parents 2c041f3 + f92841f commit fe46082
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function testBarebonesConfig(): void
$config = $this->project_analyzer->getConfig();

$this->assertTrue($config->isInProjectDirs(realpath('src/Psalm/Type.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/StringAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/TemplateScanner.php')));
}

public function testIgnoreProjectDirectory(): void
Expand All @@ -129,7 +129,7 @@ public function testIgnoreProjectDirectory(): void

$this->assertTrue($config->isInProjectDirs(realpath('src/Psalm/Type.php')));
$this->assertFalse($config->isInProjectDirs(realpath('src/Psalm/Internal/Analyzer/FileAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/StringAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/TemplateScanner.php')));
}

public function testIgnoreMissingProjectDirectory(): void
Expand All @@ -152,8 +152,8 @@ public function testIgnoreMissingProjectDirectory(): void
$config = $this->project_analyzer->getConfig();

$this->assertTrue($config->isInProjectDirs(realpath('src/Psalm/Type.php')));
$this->assertFalse($config->isInProjectDirs(realpath('does/not/exist/FileAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/StringAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath(__DIR__.'/../../').'/does/not/exist/FileAnalyzer.php'));
$this->assertFalse($config->isInProjectDirs(realpath('examples/TemplateScanner.php')));
}

public function testIgnoreSymlinkedProjectDirectory(): void
Expand Down Expand Up @@ -199,7 +199,7 @@ public function testIgnoreSymlinkedProjectDirectory(): void

$this->assertTrue($config->isInProjectDirs(realpath('tests/AnnotationTest.php')));
$this->assertFalse($config->isInProjectDirs(realpath('tests/fixtures/symlinktest/a/ignoreme.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/StringAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/TemplateScanner.php')));

$regex = '/^unlink\([^\)]+\): (?:Permission denied|No such file or directory)$/';
$last_error = error_get_last();
Expand Down Expand Up @@ -247,7 +247,7 @@ public function testIgnoreWildcardProjectDirectory(): void
$this->assertTrue($config->isInProjectDirs(realpath('src/Psalm/Type.php')));
$this->assertFalse($config->isInProjectDirs(realpath('src/Psalm/Internal/Analyzer/FileAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/StringAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/TemplateScanner.php')));
}

public function testIgnoreWildcardFiles(): void
Expand All @@ -272,7 +272,7 @@ public function testIgnoreWildcardFiles(): void
$this->assertTrue($config->isInProjectDirs(realpath('src/Psalm/Type.php')));
$this->assertFalse($config->isInProjectDirs(realpath('src/Psalm/Internal/Analyzer/FileAnalyzer.php')));
$this->assertTrue($config->isInProjectDirs(realpath('src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/StringAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/TemplateScanner.php')));
}

public function testIgnoreWildcardFilesInWildcardFolder(): void
Expand Down Expand Up @@ -328,7 +328,6 @@ public function testIgnoreWildcardFilesInAllPossibleWildcardFolders(): void
$this->assertTrue($config->isInProjectDirs(realpath('src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php')));
$this->assertFalse($config->isInProjectDirs(realpath('src/Psalm/Internal/Analyzer/FileAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php')));
$this->assertFalse($config->isInProjectDirs(realpath('examples/StringAnalyzer.php')));
}

public function testIssueHandler(): void
Expand All @@ -352,7 +351,7 @@ public function testIssueHandler(): void

$config = $this->project_analyzer->getConfig();

$this->assertFalse($config->reportIssueInFile('MissingReturnType', realpath('tests/ConfigTest.php')));
$this->assertFalse($config->reportIssueInFile('MissingReturnType', realpath(__FILE__)));
$this->assertFalse($config->reportIssueInFile('MissingReturnType', realpath('src/Psalm/Type.php')));
}

Expand Down

0 comments on commit fe46082

Please sign in to comment.