Permalink
Browse files

Adding backwards compatible plugin syntax.

Thie got lost during 2.0, and it inflecting only the shell name
is kind of bad.
  • Loading branch information...
markstory committed Oct 20, 2011
1 parent bad8197 commit 7a4aa401d1a0de4a63ba8f9694327ba730c816ca
Showing with 6 additions and 0 deletions.
  1. +1 −0 lib/Cake/Console/ShellDispatcher.php
  2. +5 −0 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
@@ -206,6 +206,7 @@ public function dispatch() {
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell, true);
+ $plugin = Inflector::camelize($plugin);
$class = Inflector::camelize($shell) . 'Shell';
App::uses('Shell', 'Console');
@@ -129,6 +129,7 @@ public function setUp() {
* @return void
*/
public function tearDown() {
+ parent::tearDown();
CakePlugin::unload();
}
@@ -399,6 +400,10 @@ public function testGetShell() {
$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);

0 comments on commit 7a4aa40

Please sign in to comment.