mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
"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:
parent
fa787aa82b
commit
657c28403a
2 changed files with 10 additions and 5 deletions
|
@ -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.
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue