adjust tests

This could really use some more tests but this has to suffice for now.
This commit is contained in:
Andreas Gohr
2024-02-27 15:54:14 +01:00
parent 28af4b6776
commit 1eeb87d74f
6 changed files with 321 additions and 410 deletions

View File

@@ -14,6 +14,16 @@ class Path
$this->paths = $this->parsePathConfig($pathConfig);
}
/**
* Access the parsed paths
*
* @return array
*/
public function getPaths()
{
return $this->paths;
}
/**
* Parse the path configuration into an internal array
*
@@ -133,7 +143,7 @@ class Path
for ($i = 0; $i < $counter; $i++) {
if ('.' == $path[$i]) continue;
if ('' === $path[$i] && $i > 0) continue;
if ('..' == $path[$i] && '..' != $output[count($output) - 1]) {
if ('..' == $path[$i] && '..' != ($output[count($output) - 1] ?? '')) {
array_pop($output);
continue;
}