Skip to content

Commit

Permalink
Merge pull request #379 from cakephp/prefix-controller-test
Browse files Browse the repository at this point in the history
Remove duplicate prefix name being applied.
  • Loading branch information
markstory authored Nov 23, 2017
2 parents 9fcd0f3 + 79bf6b9 commit 0ba0910
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/Shell/Task/ControllerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ public function bakeTest($className)
}
$this->Test->plugin = $this->plugin;
$this->Test->connection = $this->connection;
$prefix = $this->_getPrefix();
if ($prefix) {
$className = str_replace('/', '\\', $prefix) . '\\' . $className;
}

return $this->Test->bake('Controller', $className);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Shell/Task/ControllerTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function testBakePrefixed()

$this->Task->Test->expects($this->at(0))
->method('bake')
->with('Controller', 'Admin\BakeArticles');
->with('Controller', 'BakeArticles');
$result = $this->Task->bake('BakeArticles');

$this->assertTextContains('namespace App\Controller\Admin;', $result);
Expand All @@ -268,7 +268,7 @@ public function testBakePrefixNested()

$this->Task->Test->expects($this->at(0))
->method('bake')
->with('Controller', 'Admin\Management\BakeArticles');
->with('Controller', 'BakeArticles');
$result = $this->Task->bake('BakeArticles');

$this->assertTextContains('namespace App\Controller\Admin\Management;', $result);
Expand Down

0 comments on commit 0ba0910

Please sign in to comment.