From e09f825f8bec1d905cd6405865ef723f0ad26f86 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sun, 15 May 2011 00:14:41 -0430 Subject: [PATCH] Fixing controller tests --- lib/Cake/Controller/Scaffold.php | 2 +- lib/Cake/Test/Case/Controller/ControllerTest.php | 2 +- lib/Cake/Test/Case/Controller/PagesControllerTest.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Controller/Scaffold.php b/lib/Cake/Controller/Scaffold.php index 054e3a1a3..2f10bbb1b 100644 --- a/lib/Cake/Controller/Scaffold.php +++ b/lib/Cake/Controller/Scaffold.php @@ -125,7 +125,7 @@ class Scaffold { } $this->ScaffoldModel = $this->controller->{$this->modelClass}; - $this->scaffoldTitle = Inflector::humanize($this->viewPath); + $this->scaffoldTitle = Inflector::humanize(Inflector::underscore($this->viewPath)); $this->scaffoldActions = $controller->scaffold; $title_for_layout = __d('cake', 'Scaffold :: ') . Inflector::humanize($request->action) . ' :: ' . $this->scaffoldTitle; $modelClass = $this->controller->modelClass; diff --git a/lib/Cake/Test/Case/Controller/ControllerTest.php b/lib/Cake/Test/Case/Controller/ControllerTest.php index af748b8b6..75ebf7625 100644 --- a/lib/Cake/Test/Case/Controller/ControllerTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerTest.php @@ -689,7 +689,7 @@ class ControllerTest extends CakeTestCase { $Controller->constructClasses(); $Controller->Test->viewclass = 'Theme'; $Controller->viewPath = 'posts'; - $Controller->theme = 'test_theme'; + $Controller->theme = 'TestTheme'; $result = $Controller->render('index'); $this->assertPattern('/default test_theme layout/', $result); App::build(); diff --git a/lib/Cake/Test/Case/Controller/PagesControllerTest.php b/lib/Cake/Test/Case/Controller/PagesControllerTest.php index 20c4b0481..cebf1c365 100644 --- a/lib/Cake/Test/Case/Controller/PagesControllerTest.php +++ b/lib/Cake/Test/Case/Controller/PagesControllerTest.php @@ -55,10 +55,10 @@ class PagesControllerTest extends CakeTestCase { $this->assertPattern('/posts index/', $Pages->getResponse()->body()); $this->assertEqual($Pages->viewVars['page'], 'index'); - $Pages->viewPath = 'themed'; - $Pages->display('test_theme', 'posts', 'index'); + $Pages->viewPath = 'Themed'; + $Pages->display('TestTheme', 'Posts', 'index'); $this->assertPattern('/posts index themed view/', $Pages->getResponse()->body()); - $this->assertEqual($Pages->viewVars['page'], 'test_theme'); - $this->assertEqual($Pages->viewVars['subpage'], 'posts'); + $this->assertEqual($Pages->viewVars['page'], 'TestTheme'); + $this->assertEqual($Pages->viewVars['subpage'], 'Posts'); } }