diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 103a1d21010..da2ddd148f2 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -92,7 +92,7 @@ function execute() { $actions= $this->bakeActions($controller, $admin); } } - + if (!empty($this->args[2]) && $this->args[2] == 'admin') { $admin = $this->Project->getAdmin(); if ($admin) { @@ -294,8 +294,8 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $controllerPath = $this->_controllerPath($controllerName); $pluralName = $this->_pluralName($currentModelName); $singularName = Inflector::variable($currentModelName); - $singularHumanName = Inflector::humanize($currentModelName); - $pluralHumanName = Inflector::humanize($controllerName); + $singularHumanName = $this->_singularHumanName($currentModelName); + $pluralHumanName = $this->_pluralName($controllerName); $this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName', 'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName')); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index b79dc0b4b42..c3ed754985a 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -284,9 +284,7 @@ function __loadController() { $primaryKey = $modelObj->primaryKey; $displayField = $modelObj->displayField; $singularVar = Inflector::variable($modelClass); - $pluralVar = Inflector::variable($this->controllerName); - $singularHumanName = Inflector::humanize($modelClass); - $pluralHumanName = Inflector::humanize($this->controllerName); + $singularHumanName = $this->_singularHumanName($modelClass); $schema = $modelObj->schema(); $fields = array_keys($schema); $associations = $this->__associations($modelObj); @@ -294,13 +292,13 @@ function __loadController() { $primaryKey = null; $displayField = null; $singularVar = Inflector::variable(Inflector::singularize($this->controllerName)); - $pluralVar = Inflector::variable($this->controllerName); - $singularHumanName = Inflector::humanize(Inflector::singularize($this->controllerName)); - $pluralHumanName = Inflector::humanize($this->controllerName); + $singularHumanName = $this->_singularHumanName($this->controllerName); $fields = array(); $schema = array(); $associations = array(); } + $pluralVar = Inflector::variable($this->controllerName); + $pluralHumanName = $this->_pluralHumanName($this->controllerName); return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', 'singularHumanName', 'pluralHumanName', 'fields','associations'); diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 4358200a5b7..4ce888cd39b 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -260,11 +260,11 @@ function testBakeActions() { $this->Task->expectAt(0, 'createFile', array( TMP . 'view_task_comments' . DS . 'view.ctp', - new PatternExpectation('/ViewTaskComments/') + new PatternExpectation('/View Task Comments/') )); $this->Task->expectAt(1, 'createFile', array( TMP . 'view_task_comments' . DS . 'edit.ctp', - new PatternExpectation('/Edit ViewTaskComment/') + new PatternExpectation('/Edit View Task Comment/') )); $this->Task->expectAt(2, 'createFile', array( TMP . 'view_task_comments' . DS . 'index.ctp', @@ -389,11 +389,11 @@ function testExecuteInteractive() { )); $this->Task->expectAt(2, 'createFile', array( TMP . 'view_task_comments' . DS . 'add.ctp', - new PatternExpectation('/Add ViewTaskComment/') + new PatternExpectation('/Add View Task Comment/') )); $this->Task->expectAt(3, 'createFile', array( TMP . 'view_task_comments' . DS . 'edit.ctp', - new PatternExpectation('/Edit ViewTaskComment/') + new PatternExpectation('/Edit View Task Comment/') )); $this->Task->execute(); @@ -426,11 +426,11 @@ function testExecuteInteractiveWithAdmin() { )); $this->Task->expectAt(2, 'createFile', array( TMP . 'view_task_comments' . DS . 'admin_add.ctp', - new PatternExpectation('/Add ViewTaskComment/') + new PatternExpectation('/Add View Task Comment/') )); $this->Task->expectAt(3, 'createFile', array( TMP . 'view_task_comments' . DS . 'admin_edit.ctp', - new PatternExpectation('/Edit ViewTaskComment/') + new PatternExpectation('/Edit View Task Comment/') )); $this->Task->execute();