From 6eb0fe7cfb461cd9a2b128c7ff91c0cf9af0c329 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Tue, 17 Jun 2014 19:42:26 +0200 Subject: [PATCH] Fixing plugin's AppController bake generation It was being baked into the top folder instead of src --- src/Console/Command/Task/PluginTask.php | 2 +- tests/TestCase/Console/Command/Task/PluginTaskTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Console/Command/Task/PluginTask.php b/src/Console/Command/Task/PluginTask.php index 2649dbdebcb..f8b5dbfb225 100644 --- a/src/Console/Command/Task/PluginTask.php +++ b/src/Console/Command/Task/PluginTask.php @@ -139,7 +139,7 @@ public function bake($plugin) { $out .= "use App\\Controller\\AppController as BaseController;\n\n"; $out .= "class AppController extends BaseController {\n\n"; $out .= "}\n"; - $this->createFile($this->path . $plugin . DS . 'Controller' . DS . $controllerFileName, $out); + $this->createFile($this->path . $plugin . DS . $classBase . DS . 'Controller' . DS . $controllerFileName, $out); $this->_modifyBootstrap($plugin); $this->_generatePhpunitXml($plugin, $this->path); diff --git a/tests/TestCase/Console/Command/Task/PluginTaskTest.php b/tests/TestCase/Console/Command/Task/PluginTaskTest.php index 625390c9243..9cdc4fcbbcb 100644 --- a/tests/TestCase/Console/Command/Task/PluginTaskTest.php +++ b/tests/TestCase/Console/Command/Task/PluginTaskTest.php @@ -75,7 +75,7 @@ public function testBakeFoldersAndFiles() { $path = $this->Task->path . 'BakeTestPlugin'; - $file = $path . DS . 'Controller' . DS . 'AppController.php'; + $file = $path . DS . 'src' . DS . 'Controller' . DS . 'AppController.php'; $this->Task->expects($this->at(1))->method('createFile') ->with($file, $this->stringContains('namespace BakeTestPlugin\Controller;')); @@ -140,7 +140,7 @@ public function testExecuteWithOneArg() { ->will($this->returnValue('y')); $path = $this->Task->path . 'BakeTestPlugin'; - $file = $path . DS . 'Controller' . DS . 'AppController.php'; + $file = $path . DS . 'src' . DS . 'Controller' . DS . 'AppController.php'; $this->Task->expects($this->at(1))->method('createFile') ->with($file, $this->stringContains('class AppController extends BaseController {'));