Adding tests for creating directories with trailing slashes. Closes #520

This commit is contained in:
Mark Story 2010-03-30 22:35:49 -04:00
parent 5b1e9f6f5f
commit 176c12e5fe

View file

@ -99,6 +99,23 @@ class FolderTest extends CakeTestCase {
$this->assertTrue($result);
rmdir(TMP . 'tests' . DS . 'first');
}
/**
* test that creation of folders with trailing ds works
*
* @return void
*/
function testCreateWithTrailingDs() {
$folder =& new Folder(TMP);
$path = TMP . 'tests' . DS . 'trailing' . DS . 'dir' . DS;
$folder->create($path);
$this->assertTrue(is_dir($path), 'Folder was not made');
$folder =& new Folder(TMP . 'tests' . DS . 'trailing');
$this->assertTrue($folder->delete());
}
/**
* test recurisve directory create failure.
*