Skip to content

Commit

Permalink
fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orklah authored and ondrejmirtes committed Jan 2, 2020
1 parent dcb7bc2 commit 8e71e56
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Testing/LevelsTestCase.php
Expand Up @@ -31,7 +31,7 @@ public function testLevels(
string $topic
): void
{
$file = sprintf('%s/%s.php', $this->getDataPath(), $topic);
$file = sprintf('%s' . DIRECTORY_SEPARATOR . '%s.php', $this->getDataPath(), $topic);
$command = escapeshellcmd($this->getPhpStanExecutablePath());
$configPath = $this->getPhpStanConfigPath();
$fileHelper = new FileHelper(__DIR__ . '/../..');
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Expand Up @@ -185,7 +185,7 @@ public function testCollectWarnings(): void
$errors = $this->runAnalyse(__DIR__ . '/data/declaration-warning.php');
$this->assertCount(1, $errors);
$this->assertSame('Declaration of DeclarationWarning\Bar::doFoo(int $i): void should be compatible with DeclarationWarning\Foo::doFoo(): void', $errors[0]->getMessage());
$this->assertSame(__DIR__ . '/data/declaration-warning.php', $errors[0]->getFile());
$this->assertSame(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'declaration-warning.php', $errors[0]->getFile());
$this->assertSame(PHP_VERSION_ID >= 70400 ? 22 : 27, $errors[0]->getLine());
}

Expand Down
34 changes: 17 additions & 17 deletions tests/PHPStan/Command/CommandHelperTest.php
Expand Up @@ -160,24 +160,24 @@ public function dataResolveRelativePaths(): array
[
__DIR__ . '/relative-paths/root.neon',
[
'bootstrap' => __DIR__ . '/relative-paths/here.php',
'bootstrap' => __DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'here.php',
'autoload_files' => [
__DIR__ . '/relative-paths/here.php',
__DIR__ . '/relative-paths/test/there.php',
__DIR__ . '/up.php',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'here.php',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'there.php',
__DIR__ . DIRECTORY_SEPARATOR . 'up.php',
],
'autoload_directories' => [
__DIR__ . '/relative-paths/src',
__DIR__ . '/relative-paths',
realpath(__DIR__ . '/../../../conf'),
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'src',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths',
realpath(__DIR__ . '/../../../') . '/conf',
],
'paths' => [
__DIR__ . '/relative-paths/src',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'src',
],
'memoryLimitFile' => __DIR__ . '/relative-paths/.memory_limit',
'memoryLimitFile' => __DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . '.memory_limit',
'excludes_analyse' => [
__DIR__ . '/relative-paths/src',
__DIR__ . '/relative-paths/src/*/data',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'src',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . '*' . DIRECTORY_SEPARATOR . 'data',
'*/src/*/data',
],
],
Expand All @@ -186,20 +186,20 @@ public function dataResolveRelativePaths(): array
__DIR__ . '/relative-paths/nested/nested.neon',
[
'autoload_files' => [
__DIR__ . '/relative-paths/nested/here.php',
__DIR__ . '/relative-paths/nested/test/there.php',
__DIR__ . '/relative-paths/up.php',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'nested' . DIRECTORY_SEPARATOR . 'here.php',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'nested' . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'there.php',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'up.php',
],
'ignoreErrors' => [
[
'message' => '#aaa#',
'path' => __DIR__ . '/relative-paths/nested/src/aaa.php',
'path' => __DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'nested' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'aaa.php',
],
[
'message' => '#bbb#',
'paths' => [
__DIR__ . '/relative-paths/src/aaa.php',
__DIR__ . '/relative-paths/nested/src/bbb.php',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'aaa.php',
__DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR . 'nested' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'bbb.php',
],
],
],
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPStan/Node/FileNodeTest.php
Expand Up @@ -29,7 +29,7 @@ public function getNodeType(): string
public function processNode(Node $node, Scope $scope): array
{
$nodes = $node->getNodes();
$pathHelper = new SimpleRelativePathHelper(__DIR__ . '/data');
$pathHelper = new SimpleRelativePathHelper(__DIR__ . DIRECTORY_SEPARATOR . 'data');
if (!isset($nodes[0])) {
return [
RuleErrorBuilder::message(sprintf('File %s is empty.', $pathHelper->getRelativePath($scope->getFile())))->line(1)->build(),
Expand Down

0 comments on commit 8e71e56

Please sign in to comment.