mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating Shell and Bake tasks to use App::path() instead of Configure::read().
This commit is contained in:
parent
5c9b5febdf
commit
dc98184086
12 changed files with 13 additions and 12 deletions
|
@ -589,7 +589,7 @@ class Shell extends Object {
|
||||||
* @return string $path path to the correct plugin.
|
* @return string $path path to the correct plugin.
|
||||||
**/
|
**/
|
||||||
function _pluginPath($pluginName) {
|
function _pluginPath($pluginName) {
|
||||||
$pluginPaths = Configure::read('pluginPaths');
|
$pluginPaths = App::path('plugins');
|
||||||
$pluginDirName = Inflector::underscore($pluginName);
|
$pluginDirName = Inflector::underscore($pluginName);
|
||||||
foreach ($pluginPaths as $path) {
|
foreach ($pluginPaths as $path) {
|
||||||
if (is_dir($path . $pluginDirName)) {
|
if (is_dir($path . $pluginDirName)) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ class FixtureTask extends Shell {
|
||||||
parent::__construct($dispatch);
|
parent::__construct($dispatch);
|
||||||
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
|
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
|
||||||
if (!class_exists('CakeSchema')) {
|
if (!class_exists('CakeSchema')) {
|
||||||
App::import('Model', 'Schema');
|
App::import('Model', 'CakeSchema');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -184,6 +184,7 @@ class TemplateTask extends Shell {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->err(sprintf(__('Could not find template for %s', true), $filename));
|
$this->err(sprintf(__('Could not find template for %s', true), $filename));
|
||||||
|
$this->_stop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,9 @@ class ControllerTaskTest extends CakeTestCase {
|
||||||
$this->Dispatcher =& new TestControllerTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestControllerTaskMockShellDispatcher();
|
||||||
$this->Task =& new MockControllerTask($this->Dispatcher);
|
$this->Task =& new MockControllerTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch =& new $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 =& new TemplateTask($this->Task->Dispatch);
|
||||||
|
$this->Task->Template->params['theme'] = 'default';
|
||||||
$this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch);
|
$this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch);
|
||||||
$this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch);
|
$this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,7 @@ class DbConfigTaskTest extends CakeTestCase {
|
||||||
$this->Dispatcher =& new TestDbConfigTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestDbConfigTaskMockShellDispatcher();
|
||||||
$this->Task =& new MockDbConfigTask($this->Dispatcher);
|
$this->Task =& new MockDbConfigTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch =& new $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->params['working'] = rtrim(APP, '/');
|
$this->Task->params['working'] = rtrim(APP, '/');
|
||||||
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
|
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
|
||||||
|
|
|
@ -74,7 +74,7 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->Task->Model =& new MockFixtureModelTask();
|
$this->Task->Model =& new MockFixtureModelTask();
|
||||||
$this->Task->Dispatch = new $this->Dispatcher;
|
$this->Task->Dispatch = new $this->Dispatcher;
|
||||||
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
|
$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();
|
$this->Task->Template->initialize();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -83,7 +83,7 @@ class ModelTaskTest extends CakeTestCase {
|
||||||
$this->Dispatcher =& new TestModelTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestModelTaskMockShellDispatcher();
|
||||||
$this->Task =& new MockModelTask($this->Dispatcher);
|
$this->Task =& new MockModelTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch =& new $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 =& new TemplateTask($this->Task->Dispatch);
|
||||||
$this->Task->Fixture =& new MockModelTaskFixtureTask();
|
$this->Task->Fixture =& new MockModelTaskFixtureTask();
|
||||||
$this->Task->Test =& new MockModelTaskFixtureTask();
|
$this->Task->Test =& new MockModelTaskFixtureTask();
|
||||||
|
|
|
@ -66,7 +66,7 @@ class PluginTaskTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function startTest() {
|
function startTest() {
|
||||||
$this->Dispatcher =& new TestPluginTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestPluginTaskMockShellDispatcher();
|
||||||
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
|
$this->Dispatcher->shellPaths = App::path('shells');
|
||||||
$this->Task =& new MockPluginTask($this->Dispatcher);
|
$this->Task =& new MockPluginTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch =& $this->Dispatcher;
|
$this->Task->Dispatch =& $this->Dispatcher;
|
||||||
$this->Task->path = TMP . 'tests' . DS;
|
$this->Task->path = TMP . 'tests' . DS;
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function startTest() {
|
function startTest() {
|
||||||
$this->Dispatcher =& new TestProjectTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestProjectTaskMockShellDispatcher();
|
||||||
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
|
$this->Dispatcher->shellPaths = App::path('shells');
|
||||||
$this->Task =& new MockProjectTask($this->Dispatcher);
|
$this->Task =& new MockProjectTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch =& $this->Dispatcher;
|
$this->Task->Dispatch =& $this->Dispatcher;
|
||||||
$this->Task->path = TMP . 'tests' . DS;
|
$this->Task->path = TMP . 'tests' . DS;
|
||||||
|
|
|
@ -62,7 +62,7 @@ class TemplateTaskTest extends CakeTestCase {
|
||||||
$this->Dispatcher =& new TestTemplateTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestTemplateTaskMockShellDispatcher();
|
||||||
$this->Task =& new MockTemplateTask($this->Dispatcher);
|
$this->Task =& new MockTemplateTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch = new $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() {
|
function startTest() {
|
||||||
$this->Dispatcher =& new TestTestTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestTestTaskMockShellDispatcher();
|
||||||
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
|
$this->Dispatcher->shellPaths = App::path('shells');
|
||||||
$this->Task =& new MockTestTask($this->Dispatcher);
|
$this->Task =& new MockTestTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch =& $this->Dispatcher;
|
$this->Task->Dispatch =& $this->Dispatcher;
|
||||||
$this->Task->Template =& new TemplateTask($this->Dispatcher);
|
$this->Task->Template =& new TemplateTask($this->Dispatcher);
|
||||||
|
|
|
@ -103,7 +103,7 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function startTest() {
|
function startTest() {
|
||||||
$this->Dispatcher =& new TestViewTaskMockShellDispatcher();
|
$this->Dispatcher =& new TestViewTaskMockShellDispatcher();
|
||||||
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
|
$this->Dispatcher->shellPaths = App::path('shells');
|
||||||
$this->Task =& new MockViewTask($this->Dispatcher);
|
$this->Task =& new MockViewTask($this->Dispatcher);
|
||||||
$this->Task->Dispatch =& $this->Dispatcher;
|
$this->Task->Dispatch =& $this->Dispatcher;
|
||||||
$this->Task->Template =& new TemplateTask($this->Dispatcher);
|
$this->Task->Template =& new TemplateTask($this->Dispatcher);
|
||||||
|
|
Loading…
Reference in a new issue