"Fixes #4377, Folder class bug for non-existent path"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6602 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2008-03-26 04:05:05 +00:00
parent fa787aa82b
commit 657c28403a
2 changed files with 10 additions and 5 deletions

View file

@ -110,7 +110,9 @@ class Folder extends Object{
if (!$this->isAbsolute($path)) {
$path = realpath($path);
}
$this->cd($path);
if (!empty($path)) {
$this->cd($path);
}
}
/**
* Return current path.

View file

@ -106,17 +106,20 @@ class FolderTest extends UnitTestCase {
$result = $Folder->delete($mv);
$this->assertTrue($result);
$new = TMP . 'test_folder_new';
$result = $Folder->create($new);
$this->assertTrue($result);
$result = $Folder->cd($new);
$this->assertTrue($result);
$result = $Folder->delete();
$this->assertTrue($result);
$Folder =& new Folder('non-existent');
$result = $Folder->pwd();
$this->assertNull($result);
}
function testRealPathForWebroot() {