diff --git a/cake/libs/folder.php b/cake/libs/folder.php index ebfe0ed0c..01b5a6da3 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -530,7 +530,10 @@ class Folder extends Object{ * @return boolean Success * @access public */ - function delete($path) { + function delete($path = null) { + if (!$path) { + $path = $this->pwd(); + } $path = $this->slashTerm($path); if (is_dir($path) === true) { $files = glob($path . "*", GLOB_NOSORT); diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index fbdde855e..41d800672 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -106,6 +106,17 @@ 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); + } function testRealPathForWebroot() {