From 13530f42dc32d3f4587cdc21947d6c6013e834c9 Mon Sep 17 00:00:00 2001 From: phpnut Date: Sun, 2 Dec 2007 23:03:13 +0000 Subject: [PATCH] "Correcting typo" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6106 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/controller.php | 1 + cake/tests/cases/libs/controller/controller.test.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 6075696ab..3025b1d43 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -874,6 +874,7 @@ class Controller extends Object { $object = $this->{$this->modelClass}; } else { $className = null; + $name = $this->uses[0]; if (strpos($this->uses[0], '.') !== false) { list($name, $className) = explode('.', $this->uses[0]); } diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 0f8534c57..9997f88ef 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -84,7 +84,6 @@ class ControllerTest extends CakeTestCase { $Controller->passedArgs[] = '1'; $Controller->params['url'] = array(); $Controller->constructClasses(); - $Controller->modelClass = null; $results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id'); $this->assertEqual($results, array(1, 2, 3)); @@ -92,6 +91,8 @@ class ControllerTest extends CakeTestCase { $results = Set::extract($Controller->paginate('ControllerComment'), '{n}.ControllerComment.id'); $this->assertEqual($results, array(1, 2, 3, 4, 5, 6)); + $Controller->modelClass = null; + $Controller->uses[0] = 'Plugin.ControllerPost'; $results = Set::extract($Controller->paginate(), '{n}.ControllerPost.id'); $this->assertEqual($results, array(1, 2, 3));