mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Renaming + moving test and task files around. Updating tests to use import for tasks.
This commit is contained in:
parent
2cdbd67d7d
commit
8c63f155ba
21 changed files with 59 additions and 42 deletions
|
@ -17,7 +17,7 @@
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'TaskCollection');
|
require_once CONSOLE_LIBS . 'task_collection.php';
|
||||||
require_once CAKE . 'console' . DS . 'console_output.php';
|
require_once CAKE . 'console' . DS . 'console_output.php';
|
||||||
require_once CAKE . 'console' . DS . 'console_input.php';
|
require_once CAKE . 'console' . DS . 'console_input.php';
|
||||||
|
|
|
@ -317,7 +317,7 @@ class ShellDispatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists('Shell')) {
|
if (!class_exists('Shell')) {
|
||||||
App::import('Shell', 'Shell');
|
require_once CONSOLE_LIBS . 'shell.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists($this->shellClass)) {
|
if (!class_exists($this->shellClass)) {
|
||||||
|
|
|
@ -269,7 +269,7 @@ class SchemaShell extends Shell {
|
||||||
$plugin = $this->params['plugin'];
|
$plugin = $this->params['plugin'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->params['dry']) {
|
if (!empty($this->params['dry'])) {
|
||||||
$this->__dry = true;
|
$this->__dry = true;
|
||||||
$this->out(__('Performing a dry run.'));
|
$this->out(__('Performing a dry run.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class TemplateTask extends Shell {
|
||||||
$paths = App::path('shells');
|
$paths = App::path('shells');
|
||||||
$core = array_pop($paths);
|
$core = array_pop($paths);
|
||||||
$separator = DS === '/' ? '/' : '\\\\';
|
$separator = DS === '/' ? '/' : '\\\\';
|
||||||
$core = preg_replace('#libs' . $separator . '$#', '', $core);
|
$core = preg_replace('#shells' . $separator . '$#', '', $core);
|
||||||
$paths[] = $core;
|
$paths[] = $core;
|
||||||
$Folder =& new Folder($core . 'templates' . DS . 'default');
|
$Folder =& new Folder($core . 'templates' . DS . 'default');
|
||||||
$contents = $Folder->read();
|
$contents = $Folder->read();
|
||||||
|
@ -63,6 +63,7 @@ class TemplateTask extends Shell {
|
||||||
|
|
||||||
$plugins = App::objects('plugin');
|
$plugins = App::objects('plugin');
|
||||||
foreach ($plugins as $plugin) {
|
foreach ($plugins as $plugin) {
|
||||||
|
$paths[] = $this->_pluginPath($plugin) . 'console' . DS . 'shells' . DS;
|
||||||
$paths[] = $this->_pluginPath($plugin) . 'vendors' . DS . 'shells' . DS;
|
$paths[] = $this->_pluginPath($plugin) . 'vendors' . DS . 'shells' . DS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'Acl');
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'acl.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AclShellTest class
|
* AclShellTest class
|
||||||
|
@ -58,7 +58,7 @@ class AclShellTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->Task = $this->getMock(
|
$this->Task = $this->getMock(
|
||||||
'AclShell',
|
'AclShell',
|
||||||
array('in', 'out', 'hr', 'createFile', 'error', 'err', 'clear'),
|
array('in', 'out', 'hr', 'createFile', 'error', 'err', 'clear', 'dispatchShell'),
|
||||||
array(&$this->Dispatcher, $out, $out, $in)
|
array(&$this->Dispatcher, $out, $out, $in)
|
||||||
);
|
);
|
||||||
$collection = new ComponentCollection();
|
$collection = new ComponentCollection();
|
||||||
|
@ -302,9 +302,9 @@ class AclShellTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testInitDb() {
|
function testInitDb() {
|
||||||
$this->Task->Dispatch->expects($this->once())->method('dispatch');
|
$this->Task->expects($this->once())->method('dispatchShell')
|
||||||
|
->with('schema create DbAcl');
|
||||||
|
|
||||||
$this->Task->initdb();
|
$this->Task->initdb();
|
||||||
|
|
||||||
$this->assertEqual($this->Task->Dispatch->args, array('schema', 'create', 'DbAcl'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,9 +18,9 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'Api');
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'api.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -19,13 +19,13 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
App::import('Core', 'Controller');
|
App::import('Shell', 'Bake', false);
|
||||||
|
App::import('Shell', 'tasks/model', false);
|
||||||
|
App::import('Shell', 'tasks/controller', false);
|
||||||
|
App::import('Shell', 'tasks/db_config', false);
|
||||||
|
|
||||||
|
App::import('Core', 'Controller');
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'bake.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php';
|
|
||||||
|
|
||||||
if (!class_exists('UsersController')) {
|
if (!class_exists('UsersController')) {
|
||||||
class UsersController extends Controller {
|
class UsersController extends Controller {
|
|
@ -18,10 +18,11 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'Schema', false);
|
||||||
App::import('Model', 'CakeSchema', false);
|
App::import('Model', 'CakeSchema', false);
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'schema.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -20,14 +20,15 @@
|
||||||
App::import('Core', 'ClassRegistry');
|
App::import('Core', 'ClassRegistry');
|
||||||
App::import('View', 'Helper', false);
|
App::import('View', 'Helper', false);
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', array(
|
||||||
|
'tasks/project',
|
||||||
|
'tasks/controller',
|
||||||
|
'tasks/model',
|
||||||
|
'tasks/template',
|
||||||
|
'tasks/test'
|
||||||
|
));
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'test.php';
|
|
||||||
|
|
||||||
|
|
||||||
$imported = App::import('Model', 'BakeArticle');
|
$imported = App::import('Model', 'BakeArticle');
|
||||||
$imported = $imported || App::import('Model', 'BakeComment');
|
$imported = $imported || App::import('Model', 'BakeComment');
|
|
@ -18,9 +18,9 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'tasks/DbConfig');
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php';
|
|
||||||
|
|
||||||
|
|
||||||
class TEST_DATABASE_CONFIG {
|
class TEST_DATABASE_CONFIG {
|
|
@ -21,9 +21,9 @@
|
||||||
*/
|
*/
|
||||||
App::import('Core', 'Folder');
|
App::import('Core', 'Folder');
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'tasks/Extract', false);
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'extract.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExtractTaskTest class
|
* ExtractTaskTest class
|
|
@ -18,10 +18,13 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', array(
|
||||||
|
'tasks/fixture',
|
||||||
|
'tasks/template',
|
||||||
|
'tasks/db_config'
|
||||||
|
));
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FixtureTaskTest class
|
* FixtureTaskTest class
|
|
@ -20,11 +20,13 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', array(
|
||||||
|
'tasks/model',
|
||||||
|
'tasks/fixture',
|
||||||
|
'tasks/template'
|
||||||
|
));
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelTaskTest class
|
* ModelTaskTest class
|
|
@ -20,11 +20,14 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', array(
|
||||||
|
'tasks/plugin',
|
||||||
|
'tasks/model'
|
||||||
|
));
|
||||||
|
|
||||||
App::import('Core', array('File'));
|
App::import('Core', array('File'));
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'plugin.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PluginTaskPlugin class
|
* PluginTaskPlugin class
|
|
@ -20,11 +20,11 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'tasks/project');
|
||||||
|
|
||||||
App::import('Core', 'File');
|
App::import('Core', 'File');
|
||||||
|
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProjectTask Test class
|
* ProjectTask Test class
|
|
@ -21,9 +21,9 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'tasks/template');
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TemplateTaskTest class
|
* TemplateTaskTest class
|
|
@ -20,12 +20,15 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', array(
|
||||||
|
'tasks/test',
|
||||||
|
'tasks/template'
|
||||||
|
));
|
||||||
|
|
||||||
App::import('Controller', 'Controller', false);
|
App::import('Controller', 'Controller', false);
|
||||||
App::import('Model', 'Model', false);
|
App::import('Model', 'Model', false);
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'test.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test Article model
|
* Test Article model
|
|
@ -20,13 +20,15 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', array(
|
||||||
|
'tasks/view',
|
||||||
|
'tasks/controller',
|
||||||
|
'tasks/template',
|
||||||
|
'tasks/project',
|
||||||
|
'tasks/db_config'
|
||||||
|
));
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'view.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test View Task Comment Model
|
* Test View Task Comment Model
|
|
@ -19,9 +19,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
App::import('Shell', 'Shell', false);
|
App::import('Shell', 'Shell', false);
|
||||||
|
App::import('Shell', 'TestSuite');
|
||||||
|
|
||||||
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'testsuite.php';
|
|
||||||
|
|
||||||
class TestSuiteShellTest extends CakeTestCase {
|
class TestSuiteShellTest extends CakeTestCase {
|
||||||
|
|
Loading…
Add table
Reference in a new issue