Skip to content

Commit

Permalink
Fixing plugin's AppController bake generation
Browse files Browse the repository at this point in the history
It was being baked into the top folder instead of src
  • Loading branch information
lorenzo committed Jun 17, 2014
1 parent 7edcea3 commit 6eb0fe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Console/Command/Task/PluginTask.php
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Console/Command/Task/PluginTaskTest.php
Expand Up @@ -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;'));

Expand Down Expand Up @@ -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 {'));

Expand Down

0 comments on commit 6eb0fe7

Please sign in to comment.