diff --git a/src/Console/ShellDispatcher.php b/src/Console/ShellDispatcher.php index df1d229de66..7bce8b9ce0c 100644 --- a/src/Console/ShellDispatcher.php +++ b/src/Console/ShellDispatcher.php @@ -198,7 +198,7 @@ public function findShell($shell) { protected function _shellExists($shell) { $class = array_map('Cake\Utility\Inflector::camelize', explode('.', $shell)); $class = implode('.', $class); - $class = App::className($class, 'Console/Command', 'Shell'); + $class = App::className($class, 'Shell', 'Shell'); if (class_exists($class)) { return $class; } diff --git a/src/Console/TaskRegistry.php b/src/Console/TaskRegistry.php index 3e28eb44995..8f5390c189c 100644 --- a/src/Console/TaskRegistry.php +++ b/src/Console/TaskRegistry.php @@ -48,7 +48,7 @@ public function __construct(Shell $Shell) { * @return string|false Either the correct classname or false. */ protected function _resolveClassName($class) { - return App::className($class, 'Console/Command/Task', 'Task'); + return App::className($class, 'Shell/Task', 'Task'); } /** diff --git a/src/Console/Command/BakeShell.php b/src/Shell/BakeShell.php similarity index 95% rename from src/Console/Command/BakeShell.php rename to src/Shell/BakeShell.php index 4c5e8625409..660348ec7d4 100644 --- a/src/Console/Command/BakeShell.php +++ b/src/Shell/BakeShell.php @@ -12,7 +12,7 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command; +namespace Cake\Shell; use Cake\Cache\Cache; use Cake\Console\Shell; @@ -92,11 +92,11 @@ public function main() { * Locate the tasks bake will use. * * Scans the following paths for tasks that are subclasses of - * Cake\Console\Command\Task\BakeTask: + * Cake\Shell\Task\BakeTask: * - * - Cake/Console/Command/Task/ - * - App/Console/Command/Task/ - * - Console/Command/Task for each loaded plugin + * - Cake/Shell/Task/ + * - App/Shell/Task/ + * - Shell/Task for each loaded plugin * * @return void */ @@ -126,7 +126,7 @@ public function loadTasks() { * @return array Updated tasks. */ protected function _findTasks($tasks, $path, $namespace, $prefix = false) { - $path .= 'Console/Command/Task'; + $path .= 'Shell/Task'; if (!is_dir($path)) { return $tasks; } @@ -156,7 +156,7 @@ protected function _findClassFiles($path, $namespace) { continue; } $name = $item->getBasename('.php'); - $candidates[] = $namespace . '\Console\Command\Task\\' . $name; + $candidates[] = $namespace . '\Shell\Task\\' . $name; } return $candidates; } @@ -177,7 +177,7 @@ protected function _findTaskClasses($files) { if (!$reflect->isInstantiable()) { continue; } - if (!$reflect->isSubclassOf('Cake\Console\Command\Task\BakeTask')) { + if (!$reflect->isSubclassOf('Cake\Shell\Task\BakeTask')) { continue; } $classes[] = $className; diff --git a/src/Console/Command/CommandListShell.php b/src/Shell/CommandListShell.php similarity index 99% rename from src/Console/Command/CommandListShell.php rename to src/Shell/CommandListShell.php index d296aca475e..63070e8a927 100644 --- a/src/Console/Command/CommandListShell.php +++ b/src/Shell/CommandListShell.php @@ -12,7 +12,7 @@ * @since 2.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command; +namespace Cake\Shell; use Cake\Console\ConsoleOutput; use Cake\Console\Shell; diff --git a/src/Console/Command/CompletionShell.php b/src/Shell/CompletionShell.php similarity index 99% rename from src/Console/Command/CompletionShell.php rename to src/Shell/CompletionShell.php index c72f69615f4..0fa1c6b0da1 100644 --- a/src/Console/Command/CompletionShell.php +++ b/src/Shell/CompletionShell.php @@ -12,7 +12,7 @@ * @since 2.5.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command; +namespace Cake\Shell; use Cake\Console\Shell; diff --git a/src/Console/Command/I18nShell.php b/src/Shell/I18nShell.php similarity index 98% rename from src/Console/Command/I18nShell.php rename to src/Shell/I18nShell.php index bdf3c3ade32..cc61ca2e1c8 100644 --- a/src/Console/Command/I18nShell.php +++ b/src/Shell/I18nShell.php @@ -14,7 +14,7 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command; +namespace Cake\Shell; use Cake\Console\Shell; diff --git a/src/Console/Command/OrmCacheShell.php b/src/Shell/OrmCacheShell.php similarity index 99% rename from src/Console/Command/OrmCacheShell.php rename to src/Shell/OrmCacheShell.php index 0126fdff04a..ef7ab4cf17f 100644 --- a/src/Console/Command/OrmCacheShell.php +++ b/src/Shell/OrmCacheShell.php @@ -12,7 +12,7 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command; +namespace Cake\Shell; use Cake\Cache\Cache; use Cake\Console\Shell; diff --git a/src/Console/Command/ServerShell.php b/src/Shell/ServerShell.php similarity index 99% rename from src/Console/Command/ServerShell.php rename to src/Shell/ServerShell.php index 963b751c6d6..54e9f67c1f0 100644 --- a/src/Console/Command/ServerShell.php +++ b/src/Shell/ServerShell.php @@ -13,7 +13,7 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command; +namespace Cake\Shell; use Cake\Console\Shell; use Cake\Core\Configure; diff --git a/src/Console/Command/Task/BakeTask.php b/src/Shell/Task/BakeTask.php similarity index 99% rename from src/Console/Command/Task/BakeTask.php rename to src/Shell/Task/BakeTask.php index c05fe8413bd..d851f9e080f 100644 --- a/src/Console/Command/Task/BakeTask.php +++ b/src/Shell/Task/BakeTask.php @@ -12,7 +12,7 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Cache\Cache; use Cake\Console\Shell; diff --git a/src/Console/Command/Task/BehaviorTask.php b/src/Shell/Task/BehaviorTask.php similarity index 92% rename from src/Console/Command/Task/BehaviorTask.php rename to src/Shell/Task/BehaviorTask.php index 1fdf94626ef..7ad34cb5d3a 100644 --- a/src/Console/Command/Task/BehaviorTask.php +++ b/src/Shell/Task/BehaviorTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\SimpleBakeTask; +use Cake\Shell\Task\SimpleBakeTask; /** * Behavior code generator. diff --git a/src/Console/Command/Task/CellTask.php b/src/Shell/Task/CellTask.php similarity index 95% rename from src/Console/Command/Task/CellTask.php rename to src/Shell/Task/CellTask.php index 1bd5f53e1ef..673b016fed0 100644 --- a/src/Console/Command/Task/CellTask.php +++ b/src/Shell/Task/CellTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\SimpleBakeTask; +use Cake\Shell\Task\SimpleBakeTask; /** * Task for creating cells. diff --git a/src/Console/Command/Task/CommandTask.php b/src/Shell/Task/CommandTask.php similarity index 95% rename from src/Console/Command/Task/CommandTask.php rename to src/Shell/Task/CommandTask.php index da0bd25d891..c2a88d2b09b 100644 --- a/src/Console/Command/Task/CommandTask.php +++ b/src/Shell/Task/CommandTask.php @@ -12,7 +12,7 @@ * @since 2.5.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\ConsoleOptionParser; use Cake\Console\Shell; @@ -41,18 +41,18 @@ public function getShellList() { $plugins = Plugin::loaded(); $shellList = array_fill_keys($plugins, null) + ['CORE' => null, 'app' => null]; - $corePath = App::core('Console/Command'); + $corePath = App::core('Shell'); $shells = $this->_scanDir($corePath[0]); $shells = array_diff($shells, $skipFiles, $hiddenCommands); $shellList = $this->_appendShells('CORE', $shells, $shellList); - $appPath = App::path('Console/Command'); + $appPath = App::path('Shell'); $appShells = $this->_scanDir($appPath[0]); $appShells = array_diff($appShells, $shells, $skipFiles); $shellList = $this->_appendShells('app', $appShells, $shellList); foreach ($plugins as $plugin) { - $pluginPath = Plugin::classPath($plugin) . 'Console' . DS . 'Command'; + $pluginPath = Plugin::classPath($plugin) . 'Shell'; $pluginShells = $this->_scanDir($pluginPath); $shellList = $this->_appendShells($plugin, $pluginShells, $shellList); } @@ -178,7 +178,7 @@ public function getShell($commandName) { $name = Inflector::camelize($name); $pluginDot = Inflector::camelize($pluginDot); - $class = App::className($pluginDot . $name, 'Console/Command', 'Shell'); + $class = App::className($pluginDot . $name, 'Shell', 'Shell'); if (!$class) { return false; } diff --git a/src/Console/Command/Task/ComponentTask.php b/src/Shell/Task/ComponentTask.php similarity index 92% rename from src/Console/Command/Task/ComponentTask.php rename to src/Shell/Task/ComponentTask.php index a75449ae81f..5705d32f570 100644 --- a/src/Console/Command/Task/ComponentTask.php +++ b/src/Shell/Task/ComponentTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\SimpleBakeTask; +use Cake\Shell\Task\SimpleBakeTask; /** * Component code generator. diff --git a/src/Console/Command/Task/ControllerTask.php b/src/Shell/Task/ControllerTask.php similarity index 99% rename from src/Console/Command/Task/ControllerTask.php rename to src/Shell/Task/ControllerTask.php index 8fb38721246..00f083ad8a0 100644 --- a/src/Console/Command/Task/ControllerTask.php +++ b/src/Shell/Task/ControllerTask.php @@ -12,7 +12,7 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\Shell; use Cake\Core\Configure; diff --git a/src/Console/Command/Task/ExtractTask.php b/src/Shell/Task/ExtractTask.php similarity index 99% rename from src/Console/Command/Task/ExtractTask.php rename to src/Shell/Task/ExtractTask.php index 2bbbcc75130..9d4e91acaed 100644 --- a/src/Console/Command/Task/ExtractTask.php +++ b/src/Shell/Task/ExtractTask.php @@ -12,7 +12,7 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\Shell; use Cake\Core\App; diff --git a/src/Console/Command/Task/FixtureTask.php b/src/Shell/Task/FixtureTask.php similarity index 99% rename from src/Console/Command/Task/FixtureTask.php rename to src/Shell/Task/FixtureTask.php index 2e05cc7d7ae..db2376a8e46 100644 --- a/src/Console/Command/Task/FixtureTask.php +++ b/src/Shell/Task/FixtureTask.php @@ -12,7 +12,7 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\Shell; use Cake\Core\Configure; diff --git a/src/Console/Command/Task/HelperTask.php b/src/Shell/Task/HelperTask.php similarity index 92% rename from src/Console/Command/Task/HelperTask.php rename to src/Shell/Task/HelperTask.php index 733bc1faea7..321d1416069 100644 --- a/src/Console/Command/Task/HelperTask.php +++ b/src/Shell/Task/HelperTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\SimpleBakeTask; +use Cake\Shell\Task\SimpleBakeTask; /** * Helper code generator. diff --git a/src/Console/Command/Task/ModelTask.php b/src/Shell/Task/ModelTask.php similarity index 99% rename from src/Console/Command/Task/ModelTask.php rename to src/Shell/Task/ModelTask.php index d3838a88e6f..c2ce435ba90 100644 --- a/src/Console/Command/Task/ModelTask.php +++ b/src/Shell/Task/ModelTask.php @@ -12,7 +12,7 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\Shell; use Cake\Core\Configure; diff --git a/src/Console/Command/Task/PluginTask.php b/src/Shell/Task/PluginTask.php similarity index 98% rename from src/Console/Command/Task/PluginTask.php rename to src/Shell/Task/PluginTask.php index f677808c4b3..d6f151d397a 100644 --- a/src/Console/Command/Task/PluginTask.php +++ b/src/Shell/Task/PluginTask.php @@ -12,9 +12,9 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\BakeTask; +use Cake\Shell\Task\BakeTask; use Cake\Console\Shell; use Cake\Core\App; use Cake\Utility\File; @@ -101,7 +101,7 @@ public function bake($plugin) { $classBase . DS . 'Model' . DS . 'Behavior', $classBase . DS . 'Model' . DS . 'Table', $classBase . DS . 'Model' . DS . 'Entity', - $classBase . DS . 'Console' . DS . 'Command' . DS . 'Task', + $classBase . DS . 'Shell' . DS . 'Task', $classBase . DS . 'Controller' . DS . 'Component', $classBase . DS . 'View' . DS . 'Helper', $classBase . DS . 'Template', diff --git a/src/Console/Command/Task/ProjectTask.php b/src/Shell/Task/ProjectTask.php similarity index 98% rename from src/Console/Command/Task/ProjectTask.php rename to src/Shell/Task/ProjectTask.php index af1d5320e46..34e544aea75 100644 --- a/src/Console/Command/Task/ProjectTask.php +++ b/src/Shell/Task/ProjectTask.php @@ -12,9 +12,9 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\BakeTask; +use Cake\Shell\Task\BakeTask; use Cake\Utility\Folder; /** diff --git a/src/Console/Command/Task/ShellTask.php b/src/Shell/Task/ShellTask.php similarity index 88% rename from src/Console/Command/Task/ShellTask.php rename to src/Shell/Task/ShellTask.php index 211b59631ba..bacd068677f 100644 --- a/src/Console/Command/Task/ShellTask.php +++ b/src/Shell/Task/ShellTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\SimpleBakeTask; +use Cake\Shell\Task\SimpleBakeTask; /** * Shell code generator. @@ -26,7 +26,7 @@ class ShellTask extends SimpleBakeTask { * * @var string */ - public $pathFragment = 'Console/Command/'; + public $pathFragment = 'Shell/'; /** * {@inheritDoc} diff --git a/src/Console/Command/Task/SimpleBakeTask.php b/src/Shell/Task/SimpleBakeTask.php similarity index 97% rename from src/Console/Command/Task/SimpleBakeTask.php rename to src/Shell/Task/SimpleBakeTask.php index 5f6b5b1abbb..048e1dbd5f4 100644 --- a/src/Console/Command/Task/SimpleBakeTask.php +++ b/src/Shell/Task/SimpleBakeTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; -use Cake\Console\Command\Task\BakeTask; +use Cake\Shell\Task\BakeTask; use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\Utility\Inflector; diff --git a/src/Console/Command/Task/TemplateTask.php b/src/Shell/Task/TemplateTask.php similarity index 99% rename from src/Console/Command/Task/TemplateTask.php rename to src/Shell/Task/TemplateTask.php index 9528408b1a0..07a9b7327c8 100644 --- a/src/Console/Command/Task/TemplateTask.php +++ b/src/Shell/Task/TemplateTask.php @@ -12,7 +12,7 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\Shell; use Cake\Core\App; diff --git a/src/Console/Command/Task/TestTask.php b/src/Shell/Task/TestTask.php similarity index 99% rename from src/Console/Command/Task/TestTask.php rename to src/Shell/Task/TestTask.php index c36361215a8..37bf9f30ece 100644 --- a/src/Console/Command/Task/TestTask.php +++ b/src/Shell/Task/TestTask.php @@ -12,7 +12,7 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\Shell; use Cake\Controller\Controller; @@ -52,7 +52,7 @@ class TestTask extends BakeTask { 'Component' => 'Controller\Component', 'Behavior' => 'Model\Behavior', 'Helper' => 'View\Helper', - 'Shell' => 'Console\Command', + 'Shell' => 'Shell', 'Cell' => 'View\Cell', ]; diff --git a/src/Console/Command/Task/ViewTask.php b/src/Shell/Task/ViewTask.php similarity index 99% rename from src/Console/Command/Task/ViewTask.php rename to src/Shell/Task/ViewTask.php index 3ad29892367..1996efba188 100644 --- a/src/Console/Command/Task/ViewTask.php +++ b/src/Shell/Task/ViewTask.php @@ -12,7 +12,7 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command\Task; +namespace Cake\Shell\Task; use Cake\Console\Shell; use Cake\Core\App; diff --git a/src/Console/Command/TestShell.php b/src/Shell/TestShell.php similarity index 98% rename from src/Console/Command/TestShell.php rename to src/Shell/TestShell.php index 118706dd1db..6eaa6427c9b 100644 --- a/src/Console/Command/TestShell.php +++ b/src/Shell/TestShell.php @@ -16,7 +16,7 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Console\Command; +namespace Cake\Shell; use Cake\Console\ConsoleOptionParser; use Cake\Console\Shell; diff --git a/src/Template/Bake/default/classes/shell.ctp b/src/Template/Bake/default/classes/shell.ctp index 29a8ad45d3b..82652df9904 100644 --- a/src/Template/Bake/default/classes/shell.ctp +++ b/src/Template/Bake/default/classes/shell.ctp @@ -15,7 +15,7 @@ echo " -namespace \Console\Command; +namespace \Shell; use Cake\Console\Shell; @@ -31,4 +31,5 @@ class Shell extends Shell { */ public function main() { } + } diff --git a/tests/TestCase/Console/ShellDispatcherTest.php b/tests/TestCase/Console/ShellDispatcherTest.php index 54a5fd7b2e2..5cc7fed9617 100644 --- a/tests/TestCase/Console/ShellDispatcherTest.php +++ b/tests/TestCase/Console/ShellDispatcherTest.php @@ -75,18 +75,18 @@ public function testFindShellMissingPlugin() { */ public function testFindShell() { $result = $this->dispatcher->findShell('sample'); - $this->assertInstanceOf('TestApp\Console\Command\SampleShell', $result); + $this->assertInstanceOf('TestApp\Shell\SampleShell', $result); $result = $this->dispatcher->findShell('test_plugin.example'); - $this->assertInstanceOf('TestPlugin\Console\Command\ExampleShell', $result); + $this->assertInstanceOf('TestPlugin\Shell\ExampleShell', $result); $this->assertEquals('TestPlugin', $result->plugin); $this->assertEquals('Example', $result->name); $result = $this->dispatcher->findShell('TestPlugin.example'); - $this->assertInstanceOf('TestPlugin\Console\Command\ExampleShell', $result); + $this->assertInstanceOf('TestPlugin\Shell\ExampleShell', $result); $result = $this->dispatcher->findShell('TestPlugin.Example'); - $this->assertInstanceOf('TestPlugin\Console\Command\ExampleShell', $result); + $this->assertInstanceOf('TestPlugin\Shell\ExampleShell', $result); } /** @@ -98,7 +98,7 @@ public function testFindShellAliased() { ShellDispatcher::alias('short', 'test_plugin.example'); $result = $this->dispatcher->findShell('short'); - $this->assertInstanceOf('TestPlugin\Console\Command\ExampleShell', $result); + $this->assertInstanceOf('TestPlugin\Shell\ExampleShell', $result); $this->assertEquals('TestPlugin', $result->plugin); $this->assertEquals('Example', $result->name); } @@ -114,7 +114,7 @@ public function testFindShellAliasedAppShadow() { ShellDispatcher::alias('sample', 'test_plugin.example'); $result = $this->dispatcher->findShell('sample'); - $this->assertInstanceOf('TestApp\Console\Command\SampleShell', $result); + $this->assertInstanceOf('TestApp\Shell\SampleShell', $result); $this->assertEmpty($result->plugin); $this->assertEquals('Sample', $result->name); } diff --git a/tests/TestCase/Console/ShellTest.php b/tests/TestCase/Console/ShellTest.php index a9a4054105d..2a3a7db2ab5 100644 --- a/tests/TestCase/Console/ShellTest.php +++ b/tests/TestCase/Console/ShellTest.php @@ -107,8 +107,8 @@ class TestAppleTask extends Shell { class TestBananaTask extends Shell { } -class_alias(__NAMESPACE__ . '\TestAppleTask', 'Cake\Console\Command\Task\TestAppleTask'); -class_alias(__NAMESPACE__ . '\TestBananaTask', 'Cake\Console\Command\Task\TestBananaTask'); +class_alias(__NAMESPACE__ . '\TestAppleTask', 'Cake\Shell\Task\TestAppleTask'); +class_alias(__NAMESPACE__ . '\TestBananaTask', 'Cake\Shell\Task\TestBananaTask'); /** * ShellTest class @@ -331,19 +331,19 @@ public function testLoadTasks() { $this->Shell->tasks = array('TestApple'); $this->assertTrue($this->Shell->loadTasks()); - $this->assertInstanceOf('Cake\Console\Command\Task\TestAppleTask', $this->Shell->TestApple); + $this->assertInstanceOf('Cake\Shell\Task\TestAppleTask', $this->Shell->TestApple); $this->Shell->tasks = 'TestBanana'; $this->assertTrue($this->Shell->loadTasks()); - $this->assertInstanceOf('Cake\Console\Command\Task\TestAppleTask', $this->Shell->TestApple); - $this->assertInstanceOf('Cake\Console\Command\Task\TestBananaTask', $this->Shell->TestBanana); + $this->assertInstanceOf('Cake\Shell\Task\TestAppleTask', $this->Shell->TestApple); + $this->assertInstanceOf('Cake\Shell\Task\TestBananaTask', $this->Shell->TestBanana); unset($this->Shell->ShellTestApple, $this->Shell->TestBanana); $this->Shell->tasks = array('TestApple', 'TestBanana'); $this->assertTrue($this->Shell->loadTasks()); - $this->assertInstanceOf('Cake\Console\Command\Task\TestAppleTask', $this->Shell->TestApple); - $this->assertInstanceOf('Cake\Console\Command\Task\TestBananaTask', $this->Shell->TestBanana); + $this->assertInstanceOf('Cake\Shell\Task\TestAppleTask', $this->Shell->TestApple); + $this->assertInstanceOf('Cake\Shell\Task\TestBananaTask', $this->Shell->TestBanana); } /** diff --git a/tests/TestCase/Console/TaskRegistryTest.php b/tests/TestCase/Console/TaskRegistryTest.php index 1a4d7a071d0..18a3ff17e87 100644 --- a/tests/TestCase/Console/TaskRegistryTest.php +++ b/tests/TestCase/Console/TaskRegistryTest.php @@ -53,8 +53,8 @@ public function tearDown() { */ public function testLoad() { $result = $this->Tasks->load('Project'); - $this->assertInstanceOf('Cake\Console\Command\Task\ProjectTask', $result); - $this->assertInstanceOf('Cake\Console\Command\Task\ProjectTask', $this->Tasks->Project); + $this->assertInstanceOf('Cake\Shell\Task\ProjectTask', $result); + $this->assertInstanceOf('Cake\Shell\Task\ProjectTask', $this->Tasks->Project); $result = $this->Tasks->loaded(); $this->assertEquals(['Project'], $result, 'loaded() results are wrong.'); @@ -82,8 +82,8 @@ public function testLoadPluginTask() { $this->Tasks = new TaskRegistry($shell, $dispatcher); $result = $this->Tasks->load('TestPlugin.OtherTask'); - $this->assertInstanceOf('TestPlugin\Console\Command\Task\OtherTaskTask', $result, 'Task class is wrong.'); - $this->assertInstanceOf('TestPlugin\Console\Command\Task\OtherTaskTask', $this->Tasks->OtherTask, 'Class is wrong'); + $this->assertInstanceOf('TestPlugin\Shell\Task\OtherTaskTask', $result, 'Task class is wrong.'); + $this->assertInstanceOf('TestPlugin\Shell\Task\OtherTaskTask', $this->Tasks->OtherTask, 'Class is wrong'); Plugin::unload(); } @@ -96,15 +96,15 @@ public function testLoadWithAlias() { Plugin::load('TestPlugin'); $result = $this->Tasks->load('ProjectAliased', array('className' => 'Project')); - $this->assertInstanceOf('Cake\Console\Command\Task\ProjectTask', $result); - $this->assertInstanceOf('Cake\Console\Command\Task\ProjectTask', $this->Tasks->ProjectAliased); + $this->assertInstanceOf('Cake\Shell\Task\ProjectTask', $result); + $this->assertInstanceOf('Cake\Shell\Task\ProjectTask', $this->Tasks->ProjectAliased); $result = $this->Tasks->loaded(); $this->assertEquals(array('ProjectAliased'), $result, 'loaded() results are wrong.'); $result = $this->Tasks->load('SomeTask', array('className' => 'TestPlugin.OtherTask')); - $this->assertInstanceOf('TestPlugin\Console\Command\Task\OtherTaskTask', $result); - $this->assertInstanceOf('TestPlugin\Console\Command\Task\OtherTaskTask', $this->Tasks->SomeTask); + $this->assertInstanceOf('TestPlugin\Shell\Task\OtherTaskTask', $result); + $this->assertInstanceOf('TestPlugin\Shell\Task\OtherTaskTask', $this->Tasks->SomeTask); $result = $this->Tasks->loaded(); $this->assertEquals(array('ProjectAliased', 'SomeTask'), $result, 'loaded() results are wrong.'); diff --git a/tests/TestCase/Core/AppTest.php b/tests/TestCase/Core/AppTest.php index 15a3abfab35..01a7a09023f 100644 --- a/tests/TestCase/Core/AppTest.php +++ b/tests/TestCase/Core/AppTest.php @@ -114,8 +114,8 @@ public function classnameProvider() { ['App', 'Core', '', false, 'Cake\Core\App'], ['Auth', 'Controller/Component', 'Component', false, 'Cake\Controller\Component\AuthComponent'], ['File', 'Cache/Engine', 'Engine', false, 'Cake\Cache\Engine\FileEngine'], - ['Command', 'Console/Command/Task', 'Task', false, 'Cake\Console\Command\Task\CommandTask'], - ['Upgrade/Locations', 'Console/Command/Task', 'Task', false, 'Cake\Console\Command\Task\Upgrade\LocationsTask'], + ['Command', 'Shell/Task', 'Task', false, 'Cake\Shell\Task\CommandTask'], + ['Upgrade/Locations', 'Shell/Task', 'Task', false, 'Cake\Shell\Task\Upgrade\LocationsTask'], ['Pages', 'Controller', 'Controller', true, 'TestApp\Controller\PagesController'], ]; } diff --git a/tests/TestCase/Console/Command/BakeShellTest.php b/tests/TestCase/Shell/BakeShellTest.php similarity index 90% rename from tests/TestCase/Console/Command/BakeShellTest.php rename to tests/TestCase/Shell/BakeShellTest.php index b0f4080fa00..a73701ac806 100644 --- a/tests/TestCase/Console/Command/BakeShellTest.php +++ b/tests/TestCase/Shell/BakeShellTest.php @@ -12,9 +12,9 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command; +namespace Cake\Test\TestCase\Shell; -use Cake\Console\Command\BakeShellShell; +use Cake\Shell\BakeShellShell; use Cake\Controller\Controller; use Cake\Core\App; use Cake\Core\Configure; @@ -40,7 +40,7 @@ public function setUp() { $this->io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); $this->Shell = $this->getMock( - 'Cake\Console\Command\BakeShell', + 'Cake\Shell\BakeShell', ['in', 'out', 'hr', 'err', 'createFile', '_stop'], [$this->io] ); @@ -63,9 +63,9 @@ public function tearDown() { * @return void */ public function testAllWithModelName() { - $this->Shell->Model = $this->getMock('Cake\Console\Command\Task\ModelTask'); - $this->Shell->Controller = $this->getMock('Cake\Console\Command\Task\ControllerTask'); - $this->Shell->View = $this->getMock('Cake\Console\Command\Task\ModelTask'); + $this->Shell->Model = $this->getMock('Cake\Shell\Task\ModelTask'); + $this->Shell->Controller = $this->getMock('Cake\Shell\Task\ControllerTask'); + $this->Shell->View = $this->getMock('Cake\Shell\Task\ModelTask'); $this->Shell->Model->expects($this->once()) ->method('bake') diff --git a/tests/TestCase/Console/Command/CommandListShellTest.php b/tests/TestCase/Shell/CommandListShellTest.php similarity index 92% rename from tests/TestCase/Console/Command/CommandListShellTest.php rename to tests/TestCase/Shell/CommandListShellTest.php index 16abc2f5943..a738a9be05a 100644 --- a/tests/TestCase/Console/Command/CommandListShellTest.php +++ b/tests/TestCase/Shell/CommandListShellTest.php @@ -14,10 +14,10 @@ * @since 2.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command; +namespace Cake\Test\TestCase\Shell; -use Cake\Console\Command\CommandListShell; -use Cake\Console\Command\Task\CommandTask; +use Cake\Shell\CommandListShell; +use Cake\Shell\Task\CommandTask; use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOutput; use Cake\Core\App; @@ -56,13 +56,13 @@ public function setUp() { $io = new ConsoleIo($this->out); $this->Shell = $this->getMock( - 'Cake\Console\Command\CommandListShell', + 'Cake\Shell\CommandListShell', ['in', 'err', '_stop', 'clear'], [$io] ); $this->Shell->Command = $this->getMock( - 'Cake\Console\Command\Task\CommandTask', + 'Cake\Shell\Task\CommandTask', ['in', '_stop', 'err', 'clear'], [$io] ); diff --git a/tests/TestCase/Console/Command/CompletionShellTest.php b/tests/TestCase/Shell/CompletionShellTest.php similarity index 96% rename from tests/TestCase/Console/Command/CompletionShellTest.php rename to tests/TestCase/Shell/CompletionShellTest.php index 5d53c4f32ae..ba4f83c15e7 100644 --- a/tests/TestCase/Console/Command/CompletionShellTest.php +++ b/tests/TestCase/Shell/CompletionShellTest.php @@ -12,10 +12,10 @@ * @since 2.5.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command; +namespace Cake\Test\TestCase\Shell; -use Cake\Console\Command\CompletionShell; -use Cake\Console\Command\Task\CommandTask; +use Cake\Shell\CompletionShell; +use Cake\Shell\Task\CommandTask; use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOutput; use Cake\Console\Shell; @@ -54,13 +54,13 @@ public function setUp() { $io = new ConsoleIo($this->out); $this->Shell = $this->getMock( - 'Cake\Console\Command\CompletionShell', + 'Cake\Shell\CompletionShell', ['in', '_stop', 'clear'], [$io] ); $this->Shell->Command = $this->getMock( - 'Cake\Console\Command\Task\CommandTask', + 'Cake\Shell\Task\CommandTask', ['in', '_stop', 'clear'], [$io] ); diff --git a/tests/TestCase/Console/Command/OrmCacheShellTest.php b/tests/TestCase/Shell/OrmCacheShellTest.php similarity index 97% rename from tests/TestCase/Console/Command/OrmCacheShellTest.php rename to tests/TestCase/Shell/OrmCacheShellTest.php index a3df7fac5dd..392d1a3a083 100644 --- a/tests/TestCase/Console/Command/OrmCacheShellTest.php +++ b/tests/TestCase/Shell/OrmCacheShellTest.php @@ -12,10 +12,10 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command; +namespace Cake\Test\TestCase\Shell; use Cake\Cache\Cache; -use Cake\Console\Command\OrmCacheShell; +use Cake\Shell\OrmCacheShell; use Cake\Datasource\ConnectionManager; use Cake\TestSuite\TestCase; diff --git a/tests/TestCase/Console/Command/Task/CellTaskTest.php b/tests/TestCase/Shell/Task/CellTaskTest.php similarity index 93% rename from tests/TestCase/Console/Command/Task/CellTaskTest.php rename to tests/TestCase/Shell/Task/CellTaskTest.php index b117c85f020..7dcb3f4c050 100644 --- a/tests/TestCase/Console/Command/Task/CellTaskTest.php +++ b/tests/TestCase/Shell/Task/CellTaskTest.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\TemplateTask; +use Cake\Shell\Task\TemplateTask; use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\TestSuite\TestCase; @@ -34,11 +34,11 @@ public function setUp() { $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); $this->Task = $this->getMock( - 'Cake\Console\Command\Task\CellTask', + 'Cake\Shell\Task\CellTask', ['in', 'err', 'createFile', '_stop'], [$io] ); - $this->Task->Test = $this->getMock('Cake\Console\Command\Task\TestTask', + $this->Task->Test = $this->getMock('Cake\Shell\Task\TestTask', [], [$io] ); diff --git a/tests/TestCase/Console/Command/Task/ControllerTaskTest.php b/tests/TestCase/Shell/Task/ControllerTaskTest.php similarity index 96% rename from tests/TestCase/Console/Command/Task/ControllerTaskTest.php rename to tests/TestCase/Shell/Task/ControllerTaskTest.php index f4527a39d15..3b550a8dabf 100644 --- a/tests/TestCase/Console/Command/Task/ControllerTaskTest.php +++ b/tests/TestCase/Shell/Task/ControllerTaskTest.php @@ -12,10 +12,10 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\ControllerTask; -use Cake\Console\Command\Task\TemplateTask; +use Cake\Shell\Task\ControllerTask; +use Cake\Shell\Task\TemplateTask; use Cake\Console\Shell; use Cake\Core\App; use Cake\Core\Plugin; @@ -59,7 +59,7 @@ public function setUp() { parent::setUp(); $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\ControllerTask', + $this->Task = $this->getMock('Cake\Shell\Task\ControllerTask', array('in', 'out', 'err', 'hr', 'createFile', '_stop'), array($io) ); @@ -69,12 +69,12 @@ public function setUp() { $this->Task->Template = new TemplateTask($io); $this->Task->Template->params['theme'] = 'default'; - $this->Task->Model = $this->getMock('Cake\Console\Command\Task\ModelTask', + $this->Task->Model = $this->getMock('Cake\Shell\Task\ModelTask', array('in', 'out', 'err', 'createFile', '_stop'), array($io) ); $this->Task->Test = $this->getMock( - 'Cake\Console\Command\Task\TestTask', + 'Cake\Shell\Task\TestTask', [], [$io] ); diff --git a/tests/TestCase/Console/Command/Task/ExtractTaskTest.php b/tests/TestCase/Shell/Task/ExtractTaskTest.php similarity index 96% rename from tests/TestCase/Console/Command/Task/ExtractTaskTest.php rename to tests/TestCase/Shell/Task/ExtractTaskTest.php index 1a377196f77..74e1738fc12 100644 --- a/tests/TestCase/Console/Command/Task/ExtractTaskTest.php +++ b/tests/TestCase/Shell/Task/ExtractTaskTest.php @@ -12,9 +12,9 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\ExtractTask; +use Cake\Shell\Task\ExtractTask; use Cake\Core\App; use Cake\Core\Configure; use Cake\Core\Plugin; @@ -37,7 +37,7 @@ public function setUp() { $this->io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); $this->Task = $this->getMock( - 'Cake\Console\Command\Task\ExtractTask', + 'Cake\Shell\Task\ExtractTask', array('in', 'out', 'err', '_stop'), array($this->io) ); @@ -180,7 +180,7 @@ public function testExtractMultiplePaths() { */ public function testExtractExcludePlugins() { Configure::write('App.namespace', 'TestApp'); - $this->Task = $this->getMock('Cake\Console\Command\Task\ExtractTask', + $this->Task = $this->getMock('Cake\Shell\Task\ExtractTask', array('_isExtractingApp', 'in', 'out', 'err', 'clear', '_stop'), array($this->io) ); @@ -205,7 +205,7 @@ public function testExtractExcludePlugins() { public function testExtractPlugin() { Configure::write('App.namespace', 'TestApp'); - $this->Task = $this->getMock('Cake\Console\Command\Task\ExtractTask', + $this->Task = $this->getMock('Cake\Shell\Task\ExtractTask', array('_isExtractingApp', 'in', 'out', 'err', 'clear', '_stop'), array($this->io) ); diff --git a/tests/TestCase/Console/Command/Task/FixtureTaskTest.php b/tests/TestCase/Shell/Task/FixtureTaskTest.php similarity index 97% rename from tests/TestCase/Console/Command/Task/FixtureTaskTest.php rename to tests/TestCase/Shell/Task/FixtureTaskTest.php index a04ea77a0ba..48fc2084ccb 100644 --- a/tests/TestCase/Console/Command/Task/FixtureTaskTest.php +++ b/tests/TestCase/Shell/Task/FixtureTaskTest.php @@ -12,10 +12,10 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\FixtureTask; -use Cake\Console\Command\Task\TemplateTask; +use Cake\Shell\Task\FixtureTask; +use Cake\Shell\Task\TemplateTask; use Cake\Core\Plugin; use Cake\Datasource\ConnectionManager; use Cake\ORM\TableRegistry; @@ -43,11 +43,11 @@ public function setUp() { parent::setUp(); $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\FixtureTask', + $this->Task = $this->getMock('Cake\Shell\Task\FixtureTask', array('in', 'err', 'createFile', '_stop', 'clear'), array($io) ); - $this->Task->Model = $this->getMock('Cake\Console\Command\Task\ModelTask', + $this->Task->Model = $this->getMock('Cake\Shell\Task\ModelTask', array('in', 'out', 'err', 'createFile', 'getName', 'getTable', 'listAll'), array($io) ); diff --git a/tests/TestCase/Console/Command/Task/ModelTaskTest.php b/tests/TestCase/Shell/Task/ModelTaskTest.php similarity index 98% rename from tests/TestCase/Console/Command/Task/ModelTaskTest.php rename to tests/TestCase/Shell/Task/ModelTaskTest.php index e91d0cb215f..c5ddbd89b43 100644 --- a/tests/TestCase/Console/Command/Task/ModelTaskTest.php +++ b/tests/TestCase/Shell/Task/ModelTaskTest.php @@ -12,10 +12,10 @@ * @since 1.2.6 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\ModelTask; -use Cake\Console\Command\Task\TemplateTask; +use Cake\Shell\Task\ModelTask; +use Cake\Shell\Task\TemplateTask; use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\Model\Model; @@ -49,7 +49,7 @@ public function setUp() { parent::setUp(); $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\ModelTask', + $this->Task = $this->getMock('Cake\Shell\Task\ModelTask', array('in', 'err', 'createFile', '_stop', '_checkUnitTest'), array($io) ); @@ -66,7 +66,7 @@ public function setUp() { protected function _useMockedOut() { $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\ModelTask', + $this->Task = $this->getMock('Cake\Shell\Task\ModelTask', array('in', 'out', 'err', 'hr', 'createFile', '_stop', '_checkUnitTest'), array($io) ); @@ -81,8 +81,8 @@ protected function _useMockedOut() { protected function _setupOtherMocks() { $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task->Fixture = $this->getMock('Cake\Console\Command\Task\FixtureTask', [], [$io]); - $this->Task->Test = $this->getMock('Cake\Console\Command\Task\FixtureTask', [], [$io]); + $this->Task->Fixture = $this->getMock('Cake\Shell\Task\FixtureTask', [], [$io]); + $this->Task->Test = $this->getMock('Cake\Shell\Task\FixtureTask', [], [$io]); $this->Task->Template = new TemplateTask($io); $this->Task->Template->interactive = false; diff --git a/tests/TestCase/Console/Command/Task/PluginTaskTest.php b/tests/TestCase/Shell/Task/PluginTaskTest.php similarity index 95% rename from tests/TestCase/Console/Command/Task/PluginTaskTest.php rename to tests/TestCase/Shell/Task/PluginTaskTest.php index ee446065017..abc74d220e3 100644 --- a/tests/TestCase/Console/Command/Task/PluginTaskTest.php +++ b/tests/TestCase/Shell/Task/PluginTaskTest.php @@ -12,9 +12,9 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\TemplateTask; +use Cake\Shell\Task\TemplateTask; use Cake\Core\App; use Cake\Core\Configure; use Cake\Core\Plugin; @@ -36,7 +36,7 @@ public function setUp() { parent::setUp(); $this->io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\PluginTask', + $this->Task = $this->getMock('Cake\Shell\Task\PluginTask', array('in', 'err', 'createFile', '_stop', 'clear', 'callProcess'), array($this->io) ); @@ -90,7 +90,7 @@ public function testBakeFoldersAndFiles() { 'src/Model/Behavior', 'src/Model/Table', 'src/Model/Entity', - 'src/Console/Command/Task', + 'src/Shell/Task', 'src/Controller/Component', 'src/View/Helper', 'tests/TestCase/Controller/Component', @@ -224,7 +224,7 @@ public function testFindPathNonExistant() { array_unshift($paths, '/fake/path'); $paths[] = '/fake/path2'; - $this->Task = $this->getMock('Cake\Console\Command\Task\PluginTask', + $this->Task = $this->getMock('Cake\Shell\Task\PluginTask', array('in', 'out', 'err', 'createFile', '_stop'), array($this->io) ); diff --git a/tests/TestCase/Console/Command/Task/ProjectTaskTest.php b/tests/TestCase/Shell/Task/ProjectTaskTest.php similarity index 93% rename from tests/TestCase/Console/Command/Task/ProjectTaskTest.php rename to tests/TestCase/Shell/Task/ProjectTaskTest.php index f72caa17f42..6f6191a422a 100644 --- a/tests/TestCase/Console/Command/Task/ProjectTaskTest.php +++ b/tests/TestCase/Shell/Task/ProjectTaskTest.php @@ -12,9 +12,9 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\ProjectTask; +use Cake\Shell\Task\ProjectTask; use Cake\Core\Configure; use Cake\TestSuite\TestCase; use Cake\Utility\File; @@ -35,7 +35,7 @@ public function setUp() { parent::setUp(); $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\ProjectTask', + $this->Task = $this->getMock('Cake\Shell\Task\ProjectTask', array('in', 'err', 'createFile', '_stop'), array($io) ); diff --git a/tests/TestCase/Console/Command/Task/SimpleBakeTaskTest.php b/tests/TestCase/Shell/Task/SimpleBakeTaskTest.php similarity index 92% rename from tests/TestCase/Console/Command/Task/SimpleBakeTaskTest.php rename to tests/TestCase/Shell/Task/SimpleBakeTaskTest.php index 226f1df25e7..885488893b1 100644 --- a/tests/TestCase/Console/Command/Task/SimpleBakeTaskTest.php +++ b/tests/TestCase/Shell/Task/SimpleBakeTaskTest.php @@ -12,9 +12,9 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\TemplateTask; +use Cake\Shell\Task\TemplateTask; use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\TestSuite\TestCase; @@ -34,11 +34,11 @@ public function setUp() { $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); $this->Task = $this->getMock( - 'Cake\Console\Command\Task\SimpleBakeTask', + 'Cake\Shell\Task\SimpleBakeTask', ['in', 'err', 'createFile', '_stop', 'name', 'template', 'fileName'], [$io] ); - $this->Task->Test = $this->getMock('Cake\Console\Command\Task\TestTask', + $this->Task->Test = $this->getMock('Cake\Shell\Task\TestTask', [], [$io] ); @@ -181,10 +181,10 @@ public function testBakePlugin() { */ public function subclassProvider() { return [ - ['Cake\Console\Command\Task\BehaviorTask'], - ['Cake\Console\Command\Task\ComponentTask'], - ['Cake\Console\Command\Task\HelperTask'], - ['Cake\Console\Command\Task\ShellTask'], + ['Cake\Shell\Task\BehaviorTask'], + ['Cake\Shell\Task\ComponentTask'], + ['Cake\Shell\Task\HelperTask'], + ['Cake\Shell\Task\ShellTask'], ]; } diff --git a/tests/TestCase/Console/Command/Task/TemplateTaskTest.php b/tests/TestCase/Shell/Task/TemplateTaskTest.php similarity index 95% rename from tests/TestCase/Console/Command/Task/TemplateTaskTest.php rename to tests/TestCase/Shell/Task/TemplateTaskTest.php index 5f14c44ddba..a0396a2be1c 100644 --- a/tests/TestCase/Console/Command/Task/TemplateTaskTest.php +++ b/tests/TestCase/Shell/Task/TemplateTaskTest.php @@ -12,9 +12,9 @@ * @since 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\TemplateTask; +use Cake\Shell\Task\TemplateTask; use Cake\Core\App; use Cake\TestSuite\TestCase; @@ -32,7 +32,7 @@ public function setUp() { parent::setUp(); $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\TemplateTask', + $this->Task = $this->getMock('Cake\Shell\Task\TemplateTask', array('in', 'err', 'createFile', '_stop', 'clear'), array($io) ); diff --git a/tests/TestCase/Console/Command/Task/TestTaskTest.php b/tests/TestCase/Shell/Task/TestTaskTest.php similarity index 96% rename from tests/TestCase/Console/Command/Task/TestTaskTest.php rename to tests/TestCase/Shell/Task/TestTaskTest.php index af68c62e5f4..b9425ddfbbe 100644 --- a/tests/TestCase/Console/Command/Task/TestTaskTest.php +++ b/tests/TestCase/Shell/Task/TestTaskTest.php @@ -12,10 +12,10 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\TemplateTask; -use Cake\Console\Command\Task\TestTask; +use Cake\Shell\Task\TemplateTask; +use Cake\Shell\Task\TestTask; use Cake\Controller\Controller; use Cake\Core\App; use Cake\Core\Configure; @@ -51,7 +51,7 @@ public function setUp() { parent::setUp(); $this->io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\TestTask', + $this->Task = $this->getMock('Cake\Shell\Task\TestTask', array('in', 'err', 'createFile', '_stop', 'isLoadableClass'), array($this->io) ); @@ -78,7 +78,7 @@ public function tearDown() { * @return void */ public function testExecuteNoArgsPrintsTypeOptions() { - $this->Task = $this->getMockBuilder('Cake\Console\Command\Task\TestTask') + $this->Task = $this->getMockBuilder('Cake\Shell\Task\TestTask') ->disableOriginalConstructor() ->setMethods(['outputTypeChoices']) ->getMock(); @@ -117,7 +117,7 @@ public function testOutputTypeChoices() { * @return void */ public function testExecuteOneArgPrintsClassOptions() { - $this->Task = $this->getMockBuilder('Cake\Console\Command\Task\TestTask') + $this->Task = $this->getMockBuilder('Cake\Shell\Task\TestTask') ->disableOriginalConstructor() ->setMethods(['outputClassChoices']) ->getMock(); @@ -254,8 +254,8 @@ public static function realClassProvider() { ['helper', 'FormHelper', 'App\View\Helper\FormHelper'], ['Component', 'Auth', 'App\Controller\Component\AuthComponent'], ['component', 'AuthComponent', 'App\Controller\Component\AuthComponent'], - ['Shell', 'Example', 'App\Console\Command\ExampleShell'], - ['shell', 'Example', 'App\Console\Command\ExampleShell'], + ['Shell', 'Example', 'App\Shell\ExampleShell'], + ['shell', 'Example', 'App\Shell\ExampleShell'], ['Cell', 'Example', 'App\View\Cell\ExampleCell'], ['cell', 'Example', 'App\View\Cell\ExampleCell'], ]; @@ -489,7 +489,7 @@ public function testBakeShellTest() { $result = $this->Task->bake('Shell', 'Articles'); - $this->assertContains("use App\Console\Command\ArticlesShell", $result); + $this->assertContains("use App\Shell\ArticlesShell", $result); $this->assertContains('class ArticlesShellTest extends TestCase', $result); $this->assertContains('function setUp()', $result); @@ -608,8 +608,8 @@ public static function caseFileNameProvider() { array('controller', 'App\Controller\PostsController', 'TestCase/Controller/PostsControllerTest.php'), array('behavior', 'App\Model\Behavior\TreeBehavior', 'TestCase/Model/Behavior/TreeBehaviorTest.php'), array('component', 'App\Controller\Component\AuthComponent', 'TestCase/Controller/Component/AuthComponentTest.php'), - ['Shell', 'App\Console\Command\ExampleShell', 'TestCase/Console/Command/ExampleShellTest.php'], - ['shell', 'App\Console\Command\ExampleShell', 'TestCase/Console/Command/ExampleShellTest.php'], + ['Shell', 'App\Shell\ExampleShell', 'TestCase/Shell/ExampleShellTest.php'], + ['shell', 'App\Shell\ExampleShell', 'TestCase/Shell/ExampleShellTest.php'], ); } diff --git a/tests/TestCase/Console/Command/Task/ViewTaskTest.php b/tests/TestCase/Shell/Task/ViewTaskTest.php similarity index 97% rename from tests/TestCase/Console/Command/Task/ViewTaskTest.php rename to tests/TestCase/Shell/Task/ViewTaskTest.php index 1788540c84e..60789608fdd 100644 --- a/tests/TestCase/Console/Command/Task/ViewTaskTest.php +++ b/tests/TestCase/Shell/Task/ViewTaskTest.php @@ -12,10 +12,10 @@ * @since 1.2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Test\TestCase\Console\Command\Task; +namespace Cake\Test\TestCase\Shell\Task; -use Cake\Console\Command\Task\TemplateTask; -use Cake\Console\Command\Task\ViewTask; +use Cake\Shell\Task\TemplateTask; +use Cake\Shell\Task\ViewTask; use Cake\Controller\Controller; use Cake\Core\Configure; use Cake\Core\Plugin; @@ -56,7 +56,7 @@ public function intialize(array $config) { */ class ViewTaskCommentsController extends Controller { - public $modelClass = 'Cake\Test\TestCase\Console\Command\Task\ViewTaskCommentsTable'; + public $modelClass = 'Cake\Test\TestCase\Shell\Task\ViewTaskCommentsTable'; /** * Testing public controller action @@ -117,12 +117,12 @@ public function setUp() { protected function _setupTask($methods) { $io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false); - $this->Task = $this->getMock('Cake\Console\Command\Task\ViewTask', + $this->Task = $this->getMock('Cake\Shell\Task\ViewTask', $methods, [$io] ); $this->Task->Template = new TemplateTask($io); - $this->Task->Model = $this->getMock('Cake\Console\Command\Task\ModelTask', [], [$io]); + $this->Task->Model = $this->getMock('Cake\Shell\Task\ModelTask', [], [$io]); $this->Task->Template->params['template'] = 'default'; $this->Task->Template->templatePaths = ['default' => CAKE . 'Template/Bake/default/']; diff --git a/tests/test_app/Plugin/TestPlugin/src/Console/Command/ExampleShell.php b/tests/test_app/Plugin/TestPlugin/src/Shell/ExampleShell.php similarity index 95% rename from tests/test_app/Plugin/TestPlugin/src/Console/Command/ExampleShell.php rename to tests/test_app/Plugin/TestPlugin/src/Shell/ExampleShell.php index 39099f704bf..a2ffc487a72 100644 --- a/tests/test_app/Plugin/TestPlugin/src/Console/Command/ExampleShell.php +++ b/tests/test_app/Plugin/TestPlugin/src/Shell/ExampleShell.php @@ -16,7 +16,7 @@ /** * Class ExampleShell */ -namespace TestPlugin\Console\Command; +namespace TestPlugin\Shell; use Cake\Console\Shell; diff --git a/tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/OtherTaskTask.php b/tests/test_app/Plugin/TestPlugin/src/Shell/Task/OtherTaskTask.php similarity index 94% rename from tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/OtherTaskTask.php rename to tests/test_app/Plugin/TestPlugin/src/Shell/Task/OtherTaskTask.php index 80e03234c34..20f0d803ca3 100644 --- a/tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/OtherTaskTask.php +++ b/tests/test_app/Plugin/TestPlugin/src/Shell/Task/OtherTaskTask.php @@ -19,7 +19,7 @@ * Class OtherTaskTask * */ -namespace TestPlugin\Console\Command\Task; +namespace TestPlugin\Shell\Task; use Cake\Console\Shell; diff --git a/tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/WidgetTask.php b/tests/test_app/Plugin/TestPlugin/src/Shell/Task/WidgetTask.php similarity index 88% rename from tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/WidgetTask.php rename to tests/test_app/Plugin/TestPlugin/src/Shell/Task/WidgetTask.php index ae5c0b15465..022e054655a 100644 --- a/tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/WidgetTask.php +++ b/tests/test_app/Plugin/TestPlugin/src/Shell/Task/WidgetTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace TestPlugin\Console\Command\Task; +namespace TestPlugin\Shell\Task; -use Cake\Console\Command\Task\BakeTask; +use Cake\Shell\Task\BakeTask; /** * Test stub for BakeShell. diff --git a/tests/test_app/TestApp/Console/Command/Task/ZergTask.php b/tests/test_app/Plugin/TestPlugin/src/Shell/Task/ZergTask.php similarity index 89% rename from tests/test_app/TestApp/Console/Command/Task/ZergTask.php rename to tests/test_app/Plugin/TestPlugin/src/Shell/Task/ZergTask.php index c4b1000e659..bb06cc4a404 100644 --- a/tests/test_app/TestApp/Console/Command/Task/ZergTask.php +++ b/tests/test_app/Plugin/TestPlugin/src/Shell/Task/ZergTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace TestApp\Console\Command\Task; +namespace TestPlugin\Shell\Task; -use Cake\Console\Command\Task\BakeTask; +use Cake\Shell\Task\BakeTask; /** * Test stub for BakeShell. diff --git a/tests/test_app/Plugin/TestPluginTwo/src/Console/Command/ExampleShell.php b/tests/test_app/Plugin/TestPluginTwo/src/Shell/ExampleShell.php similarity index 95% rename from tests/test_app/Plugin/TestPluginTwo/src/Console/Command/ExampleShell.php rename to tests/test_app/Plugin/TestPluginTwo/src/Shell/ExampleShell.php index caac6b26a4d..51905cf49b2 100644 --- a/tests/test_app/Plugin/TestPluginTwo/src/Console/Command/ExampleShell.php +++ b/tests/test_app/Plugin/TestPluginTwo/src/Shell/ExampleShell.php @@ -17,7 +17,7 @@ * Class ExampleShell * */ -namespace TestPluginTwo\Console\Command; +namespace TestPluginTwo\Shell; use Cake\Console\Shell; diff --git a/tests/test_app/Plugin/TestPluginTwo/src/Console/Command/Task/empty b/tests/test_app/Plugin/TestPluginTwo/src/Shell/Task/empty similarity index 100% rename from tests/test_app/Plugin/TestPluginTwo/src/Console/Command/Task/empty rename to tests/test_app/Plugin/TestPluginTwo/src/Shell/Task/empty diff --git a/tests/test_app/Plugin/TestPluginTwo/src/Console/Command/WelcomeShell.php b/tests/test_app/Plugin/TestPluginTwo/src/Shell/WelcomeShell.php similarity index 95% rename from tests/test_app/Plugin/TestPluginTwo/src/Console/Command/WelcomeShell.php rename to tests/test_app/Plugin/TestPluginTwo/src/Shell/WelcomeShell.php index 538db250076..9256da67afd 100644 --- a/tests/test_app/Plugin/TestPluginTwo/src/Console/Command/WelcomeShell.php +++ b/tests/test_app/Plugin/TestPluginTwo/src/Shell/WelcomeShell.php @@ -17,7 +17,7 @@ * Class WelcomeShell * */ -namespace TestPluginTwo\Console\Command; +namespace TestPluginTwo\Shell; use Cake\Console\Shell; diff --git a/tests/test_app/TestApp/Console/Command/SampleShell.php b/tests/test_app/TestApp/Shell/SampleShell.php similarity index 96% rename from tests/test_app/TestApp/Console/Command/SampleShell.php rename to tests/test_app/TestApp/Shell/SampleShell.php index a9753eb91f8..c8901e4014c 100644 --- a/tests/test_app/TestApp/Console/Command/SampleShell.php +++ b/tests/test_app/TestApp/Shell/SampleShell.php @@ -19,7 +19,7 @@ * Class SampleShell * */ -namespace TestApp\Console\Command; +namespace TestApp\Shell; use Cake\Console\Shell; diff --git a/tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/ZergTask.php b/tests/test_app/TestApp/Shell/Task/ZergTask.php similarity index 88% rename from tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/ZergTask.php rename to tests/test_app/TestApp/Shell/Task/ZergTask.php index d7bf5152076..7b0a63a6e36 100644 --- a/tests/test_app/Plugin/TestPlugin/src/Console/Command/Task/ZergTask.php +++ b/tests/test_app/TestApp/Shell/Task/ZergTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace TestPlugin\Console\Command\Task; +namespace TestApp\Shell\Task; -use Cake\Console\Command\Task\BakeTask; +use Cake\Shell\Task\BakeTask; /** * Test stub for BakeShell. diff --git a/tests/test_app/TestApp/Console/Command/Task/empty b/tests/test_app/TestApp/Shell/Task/empty similarity index 100% rename from tests/test_app/TestApp/Console/Command/Task/empty rename to tests/test_app/TestApp/Shell/Task/empty