closes #3915, Folder delete does not require path

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6542 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-03-09 22:14:12 +00:00
parent c40bead47c
commit be09e5a90d
2 changed files with 15 additions and 1 deletions

View file

@ -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);

View file

@ -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() {