/** * 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); }
/** * 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, '\\'); }
/** * 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); }