Skip to content

Commit 6eb0fe7

Browse files
committed
Fixing plugin's AppController bake generation
It was being baked into the top folder instead of src
1 parent 7edcea3 commit 6eb0fe7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Console/Command/Task/PluginTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function bake($plugin) {
139139
$out .= "use App\\Controller\\AppController as BaseController;\n\n";
140140
$out .= "class AppController extends BaseController {\n\n";
141141
$out .= "}\n";
142-
$this->createFile($this->path . $plugin . DS . 'Controller' . DS . $controllerFileName, $out);
142+
$this->createFile($this->path . $plugin . DS . $classBase . DS . 'Controller' . DS . $controllerFileName, $out);
143143

144144
$this->_modifyBootstrap($plugin);
145145
$this->_generatePhpunitXml($plugin, $this->path);

tests/TestCase/Console/Command/Task/PluginTaskTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testBakeFoldersAndFiles() {
7575

7676
$path = $this->Task->path . 'BakeTestPlugin';
7777

78-
$file = $path . DS . 'Controller' . DS . 'AppController.php';
78+
$file = $path . DS . 'src' . DS . 'Controller' . DS . 'AppController.php';
7979
$this->Task->expects($this->at(1))->method('createFile')
8080
->with($file, $this->stringContains('namespace BakeTestPlugin\Controller;'));
8181

@@ -140,7 +140,7 @@ public function testExecuteWithOneArg() {
140140
->will($this->returnValue('y'));
141141

142142
$path = $this->Task->path . 'BakeTestPlugin';
143-
$file = $path . DS . 'Controller' . DS . 'AppController.php';
143+
$file = $path . DS . 'src' . DS . 'Controller' . DS . 'AppController.php';
144144
$this->Task->expects($this->at(1))->method('createFile')
145145
->with($file, $this->stringContains('class AppController extends BaseController {'));
146146

0 commit comments

Comments
 (0)