Skip to content
Permalink
Browse files

Fixing camelCasing of plugin name for single word plugin names.

tests added.
  • Loading branch information...
markstory committed Jun 17, 2009
1 parent 88f95bc commit 981503755ec55c9929c07feabbaac2d9af4b859b
@@ -306,7 +306,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
function bake($controllerName, $actions = '', $helpers = null, $components = null) {
$isScaffold = ($actions === 'scaffold') ? true : false;
$this->Template->set('plugin', $this->plugin);
$this->Template->set('plugin', Inflector::camelize($this->plugin));
$this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold'));
$contents = $this->Template->generate('objects', 'controller');
@@ -704,7 +704,7 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey =
}
$this->Template->set(compact('name', 'useDbConfig', 'associations', 'validate', 'primaryKey', 'useTable'));
$this->Template->set('plugin', $this->plugin);
$this->Template->set('plugin', Inflector::camelize($this->plugin));
$out = $this->Template->generate('objects', 'model');
$path = $this->path;
@@ -267,6 +267,12 @@ function testBakeWithPlugin() {
$path = APP . 'plugins' . DS . 'controller_test' . DS . 'controllers' . DS . 'articles_controller.php';
$this->Task->expectAt(0, 'createFile', array($path, '*'));
$this->Task->bake('Articles', '--actions--', array(), array(), array());
$this->Task->plugin = 'controllerTest';
$path = APP . 'plugins' . DS . 'controller_test' . DS . 'controllers' . DS . 'articles_controller.php';
$this->Task->expectAt(1, 'createFile', array(
$path, new PatternExpectation('/ArticlesController extends ControllerTestAppController/')));
$this->Task->bake('Articles', '--actions--', array(), array(), array());
}
/**
@@ -617,6 +617,13 @@ function testBakeWithPlugin() {
$path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'article.php';
$this->Task->expectAt(0, 'createFile', array($path, '*'));
$this->Task->bake('Article', array(), array());
$this->Task->plugin = 'controllerTest';
$path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'article.php';
$this->Task->expectAt(1, 'createFile', array(
$path, new PatternExpectation('/Article extends ControllerTestAppModel/')));
$this->Task->bake('Article', array(), array());
}
/**

0 comments on commit 9815037

Please sign in to comment.
You can’t perform that action at this time.