Skip to content
Permalink
Browse files

Updating Shell and Bake tasks to use App::path() instead of Configure…

…::read().
  • Loading branch information...
markstory committed Jul 7, 2009
1 parent 5c9b5fe commit dc981840860d3fa706c2f4dea4bd8a101b4953e6
@@ -589,7 +589,7 @@ function _pluralHumanName($name) {
* @return string $path path to the correct plugin.
**/
function _pluginPath($pluginName) {
$pluginPaths = Configure::read('pluginPaths');
$pluginPaths = App::path('plugins');
$pluginDirName = Inflector::underscore($pluginName);
foreach ($pluginPaths as $path) {
if (is_dir($path . $pluginDirName)) {
@@ -65,7 +65,7 @@ function __construct(&$dispatch) {
parent::__construct($dispatch);
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
if (!class_exists('CakeSchema')) {
App::import('Model', 'Schema');
App::import('Model', 'CakeSchema');
}
}
/**
@@ -184,6 +184,7 @@ function _findTemplate($path, $directory, $filename) {
}
}
$this->err(sprintf(__('Could not find template for %s', true), $filename));
$this->_stop();
return false;
}
@@ -99,8 +99,9 @@ function startTest() {
$this->Dispatcher =& new TestControllerTaskMockShellDispatcher();
$this->Task =& new MockControllerTask($this->Dispatcher);
$this->Task->Dispatch =& new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Template->params['theme'] = 'default';
$this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch);
$this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch);
}
@@ -85,8 +85,7 @@ function startTest() {
$this->Dispatcher =& new TestDbConfigTaskMockShellDispatcher();
$this->Task =& new MockDbConfigTask($this->Dispatcher);
$this->Task->Dispatch =& new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
//$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->params['working'] = rtrim(APP, '/');
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
@@ -74,7 +74,7 @@ function startTest() {
$this->Task->Model =& new MockFixtureModelTask();
$this->Task->Dispatch = new $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template->initialize();
}
/**
@@ -83,7 +83,7 @@ function startTest() {
$this->Dispatcher =& new TestModelTaskMockShellDispatcher();
$this->Task =& new MockModelTask($this->Dispatcher);
$this->Task->Dispatch =& new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Fixture =& new MockModelTaskFixtureTask();
$this->Task->Test =& new MockModelTaskFixtureTask();
@@ -66,7 +66,7 @@ class PluginTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestPluginTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockPluginTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->path = TMP . 'tests' . DS;
@@ -62,7 +62,7 @@ class ProjectTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestProjectTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockProjectTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->path = TMP . 'tests' . DS;
@@ -62,7 +62,7 @@ function startTest() {
$this->Dispatcher =& new TestTemplateTaskMockShellDispatcher();
$this->Task =& new MockTemplateTask($this->Dispatcher);
$this->Task->Dispatch = new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
}
/**
@@ -133,7 +133,7 @@ class TestTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestTestTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockTestTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Dispatcher);
@@ -103,7 +103,7 @@ class ViewTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestViewTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockViewTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Dispatcher);

0 comments on commit dc98184

Please sign in to comment.
You can’t perform that action at this time.