Browse Source

Fix prefix not being camelized in controller test cases.

Fixes #4439
mark_story 11 years ago
parent
commit
7948ed79cd

+ 2 - 2
src/Shell/Task/ControllerTask.php

@@ -117,7 +117,7 @@ class ControllerTask extends BakeTask {
 
 		$prefix = '';
 		if (isset($this->params['prefix'])) {
-			$prefix = '\\' . $this->params['prefix'];
+			$prefix = '\\' . $this->_camelize($this->params['prefix']);
 		}
 
 		$namespace = Configure::read('App.namespace');
@@ -194,7 +194,7 @@ class ControllerTask extends BakeTask {
 		$this->Test->plugin = $this->plugin;
 		$this->Test->connection = $this->connection;
 		if (!empty($this->params['prefix'])) {
-			$className = $this->params['prefix'] . '\\' . $className;
+			$className = $this->_camelize($this->params['prefix']) . '\\' . $className;
 		}
 		return $this->Test->bake('Controller', $className);
 	}

+ 1 - 1
tests/TestCase/Shell/Task/ControllerTaskTest.php

@@ -189,7 +189,7 @@ class ControllerTaskTest extends TestCase {
  * @return void
  */
 	public function testBakePrefixed() {
-		$this->Task->params['prefix'] = 'Admin';
+		$this->Task->params['prefix'] = 'admin';
 
 		$filename = $this->_normalizePath(APP . 'Controller/Admin/BakeArticlesController.php');
 		$this->Task->expects($this->at(1))