Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/Unit/SapiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ class SapiTest extends TestCase

public function testCanonicalPathResolvesDotSegments(): void
{
$this->assertSame('/a/c', Sapi::canonicalPath('/a/./b/../c', false, false));
$this->assertSame('/a', Sapi::canonicalPath('/a/b/..', false, false));
// The root of an absolute path is a drive letter on Windows and nothing
// at all on POSIX, so name it here rather than let the current drive
// decide. Everything after it is the same on both.
$root = DIRECTORY_SEPARATOR === '/' ? '' : 'C:';
$sep = DIRECTORY_SEPARATOR;

$this->assertSame($root . $sep . 'a' . $sep . 'c', Sapi::canonicalPath($root . '/a/./b/../c', false, false));
$this->assertSame($root . $sep . 'a', Sapi::canonicalPath($root . '/a/b/..', false, false));
}

public function testTheSuiteRunsOnTheCommandLine(): void
Expand Down
Loading