From 7a4aa401d1a0de4a63ba8f9694327ba730c816ca Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 19 Oct 2011 21:33:03 -0400 Subject: [PATCH] Adding backwards compatible plugin syntax. Thie got lost during 2.0, and it inflecting only the shell name is kind of bad. --- lib/Cake/Console/ShellDispatcher.php | 1 + lib/Cake/Test/Case/Console/ShellDispatcherTest.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 9b32568a3..f40aa7350 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -206,6 +206,7 @@ class ShellDispatcher { protected function _getShell($shell) { list($plugin, $shell) = pluginSplit($shell, true); + $plugin = Inflector::camelize($plugin); $class = Inflector::camelize($shell) . 'Shell'; App::uses('Shell', 'Console'); diff --git a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php index 5f0ec8a08..2e2991974 100644 --- a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php +++ b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php @@ -129,6 +129,7 @@ class ShellDispatcherTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); CakePlugin::unload(); } @@ -399,6 +400,10 @@ class ShellDispatcherTest extends CakeTestCase { $result = $Dispatcher->getShell('sample'); $this->assertInstanceOf('SampleShell', $result); + $Dispatcher = new TestShellDispatcher(); + $result = $Dispatcher->getShell('test_plugin.example'); + $this->assertInstanceOf('ExampleShell', $result); + $Dispatcher = new TestShellDispatcher(); $result = $Dispatcher->getShell('TestPlugin.example'); $this->assertInstanceOf('ExampleShell', $result);