diff --git a/lib/Cake/Console/Command/Task/PluginTask.php b/lib/Cake/Console/Command/Task/PluginTask.php index e7d754048..19a91d232 100644 --- a/lib/Cake/Console/Command/Task/PluginTask.php +++ b/lib/Cake/Console/Command/Task/PluginTask.php @@ -76,7 +76,7 @@ class PluginTask extends Shell { } if (!$this->bake($plugin)) { - $this->error(__d('cake_console', "An error occured trying to bake: %s in %s", $plugin, $this->path . Inflector::underscore($pluginPath))); + $this->error(__d('cake_console', "An error occured trying to bake: %s in %s", $plugin, $this->path . Inflector::camelize($pluginPath))); } } @@ -88,8 +88,7 @@ class PluginTask extends Shell { * @return bool */ public function bake($plugin) { - $pluginPath = Inflector::underscore($plugin); - + $pluginPath = Inflector::camelize($plugin); $pathOptions = App::path('plugins'); if (count($pathOptions) > 1) { $this->findPath($pathOptions); diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php index 995ca3198..58af189a9 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -756,6 +756,9 @@ class Shell extends Object { * @return string $path path to the correct plugin. */ function _pluginPath($pluginName) { - return App::pluginPath($pluginName); + if (CakePlugin::loaded($pluginName)) { + return CakePlugin::path($pluginName); + } + return current(App::path('plugins')) . $pluginName . DS; } } diff --git a/lib/Cake/tests/Case/Console/Command/Task/PluginTaskTest.php b/lib/Cake/tests/Case/Console/Command/Task/PluginTaskTest.php index 97452cc09..18ba45b42 100644 --- a/lib/Cake/tests/Case/Console/Command/Task/PluginTaskTest.php +++ b/lib/Cake/tests/Case/Console/Command/Task/PluginTaskTest.php @@ -65,7 +65,7 @@ class PluginTaskTest extends CakeTestCase { $this->Task->expects($this->at(0))->method('in')->will($this->returnValue($this->_testPath)); $this->Task->expects($this->at(1))->method('in')->will($this->returnValue('y')); - $path = $this->Task->path . 'bake_test_plugin'; + $path = $this->Task->path . 'BakeTestPlugin'; $file = $path . DS . 'Controller' . DS .'BakeTestPluginAppController.php'; $this->Task->expects($this->at(2))->method('createFile') @@ -77,7 +77,7 @@ class PluginTaskTest extends CakeTestCase { $this->Task->bake('BakeTestPlugin'); - $path = $this->Task->path . 'bake_test_plugin'; + $path = $this->Task->path . 'BakeTestPlugin'; $this->assertTrue(is_dir($path), 'No plugin dir %s'); $directories = array( @@ -99,7 +99,7 @@ class PluginTaskTest extends CakeTestCase { $this->assertTrue(is_dir($path . DS . $dir), 'Missing directory for ' . $dir); } - $Folder = new Folder($this->Task->path . 'bake_test_plugin'); + $Folder = new Folder($this->Task->path . 'BakeTestPlugin'); $Folder->delete(); } @@ -113,7 +113,7 @@ class PluginTaskTest extends CakeTestCase { $this->Task->expects($this->at(1))->method('in')->will($this->returnValue('3')); $this->Task->expects($this->at(2))->method('in')->will($this->returnValue('y')); - $path = $this->Task->path . 'test_plugin'; + $path = $this->Task->path . 'TestPlugin'; $file = $path . DS . 'Controller' . DS . 'TestPluginAppController.php'; $this->Task->expects($this->at(3))->method('createFile') ->with($file, new PHPUnit_Framework_Constraint_IsAnything()); @@ -140,12 +140,12 @@ class PluginTaskTest extends CakeTestCase { $this->Task->expects($this->at(1))->method('in') ->will($this->returnValue('y')); - $path = $this->Task->path . 'bake_test_plugin'; + $path = $this->Task->path . 'BakeTestPlugin'; $file = $path . DS . 'Controller' . DS . 'BakeTestPluginAppController.php'; $this->Task->expects($this->at(2))->method('createFile') ->with($file, new PHPUnit_Framework_Constraint_IsAnything()); - $path = $this->Task->path . 'bake_test_plugin'; + $path = $this->Task->path . 'BakeTestPlugin'; $file = $path . DS . 'Model' . DS . 'BakeTestPluginAppModel.php'; $this->Task->expects($this->at(3))->method('createFile') ->with($file, new PHPUnit_Framework_Constraint_IsAnything()); @@ -154,7 +154,7 @@ class PluginTaskTest extends CakeTestCase { $this->Task->execute(); - $Folder = new Folder($this->Task->path . 'bake_test_plugin'); + $Folder = new Folder($this->Task->path . 'BakeTestPlugin'); $Folder->delete(); }