Skip to content

Commit 1a95f63

Browse files
committed
Tests for symlinked standards
1 parent 54ef8ab commit 1a95f63

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/Standards/AllSniffs.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,14 @@ public static function suite()
8080
$standardDir = dirname(__FILE__).'/'.$standard.'/Tests/';
8181
}
8282

83-
$standardDir = realpath($standardDir);
8483
if (is_dir($standardDir) === false) {
8584
// No tests for this standard.
8685
continue;
8786
}
8887

8988
// Locate the actual directory that contains the standard's tests.
9089
// This is individual to each standard as they could be symlinked in.
91-
$baseDir = realpath($standardDir.'/../../');
90+
$baseDir = dirname(dirname($standardDir));
9291

9392
$di = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($standardDir));
9493

@@ -98,14 +97,14 @@ public static function suite()
9897
continue;
9998
}
10099

101-
// Tests must have the extention 'php'.
100+
// Tests must have the extension 'php'.
102101
$parts = explode('.', $file);
103102
$ext = array_pop($parts);
104103
if ($ext !== 'php') {
105104
continue;
106105
}
107106

108-
$filePath = realpath($file->getPathname());
107+
$filePath = $file->getPathname();
109108
$className = str_replace($baseDir.DIRECTORY_SEPARATOR, '', $filePath);
110109
$className = substr($className, 0, -4);
111110
$className = str_replace(DIRECTORY_SEPARATOR, '_', $className);

0 commit comments

Comments
 (0)