예제 #1
0
 /**
  * testNormalizePath method
  *
  * @return void
  */
 public function testNormalizePath()
 {
     $path = '/path/to/file';
     $result = Folder::normalizePath($path);
     $this->assertEquals('/', $result);
     $path = '\\path\\\\to\\\\file';
     $result = Folder::normalizePath($path);
     $this->assertEquals('/', $result);
     $path = 'C:\\path\\to\\file';
     $result = Folder::normalizePath($path);
     $this->assertEquals('\\', $result);
 }
예제 #2
0
 /**
  * testNormalizePath method
  *
  * @access public
  * @return void
  */
 function testNormalizePath()
 {
     $path = '/path/to/file';
     $result = Folder::normalizePath($path);
     $this->assertEqual($result, '/');
     $path = '\\path\\to\\file';
     $result = Folder::normalizePath($path);
     $this->assertEqual($result, '/');
     $path = 'C:\\path\\to\\file';
     $result = Folder::normalizePath($path);
     $this->assertEqual($result, '\\');
 }
예제 #3
0
파일: folder.php 프로젝트: quinns/REST-API
 /**
  * Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
  *
  * @param string $path Path to check
  * @return string Set of slashes ("\\" or "/")
  * @access public
  * @static
  */
 function correctSlashFor($path)
 {
     return Folder::normalizePath($path);
 }