makePathAbsolute() public méthode

The realpath() function will only work for existing files, and not for symlinks. This is a more flexible solution.
public makePathAbsolute ( string $relativePath ) : string
$relativePath string
Résultat string
 /**
  * Test FilesystemHelper::makePathAbsolute().
  */
 public function testMakePathAbsolute()
 {
     $testDir = $this->tempDir();
     chdir($testDir);
     $path = $this->filesystemHelper->makePathAbsolute('test.txt');
     $this->assertEquals($testDir . '/' . 'test.txt', $path);
     $childDir = $testDir . '/test';
     mkdir($childDir);
     chdir($childDir);
     $path = $this->filesystemHelper->makePathAbsolute('../test.txt');
     $this->assertEquals($testDir . '/' . 'test.txt', $path);
     $path = $this->filesystemHelper->makePathAbsolute('..');
     $this->assertEquals($testDir, $path);
     $this->setExpectedException('InvalidArgumentException');
     $path = $this->filesystemHelper->makePathAbsolute('nonexistent/test.txt');
 }