Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Expanding test and fixing issue where the return of Folder::create() …

…would be incorrect even though the directory was properly created. Fixes #996
  • Loading branch information...
commit ccfb1d179aec5c7333c726ddfdafdb21ef6d00c7 1 parent d6e3c31
@markstory markstory authored
Showing with 3 additions and 1 deletion.
  1. +1 −0  cake/libs/folder.php
  2. +2 −1  cake/tests/cases/libs/folder.test.php
View
1  cake/libs/folder.php
@@ -489,6 +489,7 @@ function create($pathname, $mode = false) {
$this->__errors[] = sprintf(__('%s is a file', true), $pathname);
return false;
}
+ $pathname = rtrim($pathname, DS);
$nextPathname = substr($pathname, 0, strrpos($pathname, DS));
if ($this->create($nextPathname, $mode)) {
View
3  cake/tests/cases/libs/folder.test.php
@@ -108,7 +108,8 @@ function testCreation() {
function testCreateWithTrailingDs() {
$folder =& new Folder(TMP);
$path = TMP . 'tests' . DS . 'trailing' . DS . 'dir' . DS;
- $folder->create($path);
+ $result = $folder->create($path);
+ $this->assertTrue($result);
$this->assertTrue(is_dir($path), 'Folder was not made');
Please sign in to comment.
Something went wrong with that request. Please try again.