mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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:
parent
c40bead47c
commit
be09e5a90d
2 changed files with 15 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue