Browse Source

Fixing plugin's AppController bake generation

It was being baked into the top folder instead of src
Jose Lorenzo Rodriguez 11 years ago
parent
commit
6eb0fe7cfb

+ 1 - 1
src/Console/Command/Task/PluginTask.php

@@ -139,7 +139,7 @@ class PluginTask extends BakeTask {
 			$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);

+ 2 - 2
tests/TestCase/Console/Command/Task/PluginTaskTest.php

@@ -75,7 +75,7 @@ class PluginTaskTest extends TestCase {
 
 		$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 @@ class PluginTaskTest extends TestCase {
 			->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 {'));