From e2c4c0d4de3f990b505b074cc15b94489f5013a1 Mon Sep 17 00:00:00 2001 From: ADmad Date: Tue, 8 Dec 2009 01:41:52 +0530 Subject: [PATCH] Removed adding of Html and Form helper by default to baked controllers as its not DRY and they are alrady inherited from Controller class. If var helpers is declared in AppController, Html and Form should be included there. --- .../templates/default/classes/controller.ctp | 14 +++++++++----- .../cases/console/libs/tasks/controller.test.php | 8 +++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cake/console/templates/default/classes/controller.ctp b/cake/console/templates/default/classes/controller.ctp index 392a73851..48d7b1b1c 100644 --- a/cake/console/templates/default/classes/controller.ctp +++ b/cake/console/templates/default/classes/controller.ctp @@ -29,13 +29,17 @@ class Controller extends App var $scaffold; Task->bake('Articles', '--actions--', $helpers, $components); $this->assertPattern('/class ArticlesController extends AppController/', $result); $this->assertPattern('/\$components \= array\(\'Acl\', \'Auth\'\)/', $result); - $this->assertPattern('/\$helpers \= array\(\'Html\', \'Form\', \'Ajax\', \'Time\'\)/', $result); + $this->assertPattern('/\$helpers \= array\(\'Ajax\', \'Time\'\)/', $result); $this->assertPattern('/\-\-actions\-\-/', $result); $result = $this->Task->bake('Articles', 'scaffold', $helpers, $components); @@ -268,6 +268,12 @@ class ControllerTaskTest extends CakeTestCase { $this->assertPattern('/var \$scaffold/', $result); $this->assertNoPattern('/helpers/', $result); $this->assertNoPattern('/components/', $result); + + $result = $this->Task->bake('Articles', '--actions--', array(), array()); + $this->assertPattern('/class ArticlesController extends AppController/', $result); + $this->assertNoPattern('/components/', $result); + $this->assertNoPattern('/helpers/', $result); + $this->assertPattern('/\-\-actions\-\-/', $result); } /**