Skip to content

Commit

Permalink
This will be implemented in the Folder class itself
Browse files Browse the repository at this point in the history
Revert "preventing the possibility of trying to delete / if the test dir wasn't created correctly"

This reverts commit 61c9771.
  • Loading branch information
AD7six committed Aug 2, 2009
1 parent 77f371d commit 6d6f97d
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions cake/tests/cases/console/libs/tasks/plugin.test.php
Expand Up @@ -38,6 +38,7 @@
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'plugin.php';
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';


Mock::generatePartial(
'ShellDispatcher', 'TestPluginTaskMockShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
Expand Down Expand Up @@ -187,7 +188,8 @@ function testBakeFoldersAndFiles() {
$file = $path . DS . 'bake_test_plugin_app_model.php';
$this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s');

$this->_rmDir($this->Task->path . 'bake_test_plugin');
$Folder =& new Folder($this->Task->path . 'bake_test_plugin');
$Folder->delete();
}

/**
Expand All @@ -211,7 +213,8 @@ function testExecuteWithNoArgs() {
$this->Task->args = array();
$this->Task->execute();

$this->_rmDir($path);
$Folder =& new Folder($path);
$Folder->delete();
}

/**
Expand All @@ -234,7 +237,8 @@ function testExecuteWithOneArg() {

$this->Task->execute();

$this->_rmDir($this->Task->path . 'bake_test_plugin');
$Folder =& new Folder($this->Task->path . 'bake_test_plugin');
$Folder->delete();
}

/**
Expand All @@ -255,24 +259,7 @@ function testExecuteWithTwoArgs() {
$this->Task->Model->expectOnce('loadTasks');
$this->Task->Model->expectOnce('execute');
$this->Task->execute();

$this->_rmDir($this->Task->path . 'bake_test_plugin');
}

/**
* rmDir method
*
* If the folder exists - delete it
*
* @param mixed $path
* @return void
* @access protected
*/
function _rmDir($path) {
if (is_dir($path)) {
$Folder =& new Folder($path);
$Folder->delete();
}
$Folder->delete();
}
}
?>

0 comments on commit 6d6f97d

Please sign in to comment.