getRoot() public static method

The result is a canonical path.
Since: 1.0 Added method.
Since: 2.0 Method now fails if $path is not a string.
public static getRoot ( string $path ) : string
$path string A path string.
return string The canonical root directory. Returns an empty string if the given path is relative or empty.
コード例 #1
0
ファイル: PathTest.php プロジェクト: webmozart/path-util
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage The path must be a string. Got: array
  */
 public function testGetRootFailsIfInvalidPath()
 {
     Path::getRoot(array());
 }