Ejemplo n.º 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);
 }
Ejemplo n.º 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, '\\');
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }