Browse Source

Adding backwards compatible plugin syntax.

Thie got lost during 2.0, and it inflecting only the shell name
is kind of bad.
mark_story 14 years ago
parent
commit
7a4aa401d1

+ 1 - 0
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');

+ 5 - 0
lib/Cake/Test/Case/Console/ShellDispatcherTest.php

@@ -129,6 +129,7 @@ class ShellDispatcherTest extends CakeTestCase {
  * @return void
  */
 	public function tearDown() {
+		parent::tearDown();
 		CakePlugin::unload();
 	}
 
@@ -400,6 +401,10 @@ class ShellDispatcherTest extends CakeTestCase {
 		$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);
 	}