From 2071ae1656e51bf48375f3382208404f1bbc7c74 Mon Sep 17 00:00:00 2001 From: gwoo Date: Wed, 9 Apr 2008 15:34:33 +0000 Subject: [PATCH] adding case for default params to controller.test.php git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6645 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../tests/cases/libs/controller/controller.test.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 11c248bef..60a8902a7 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -101,6 +101,19 @@ class ControllerTest extends CakeTestCase { $results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id'); $this->assertEqual($Controller->params['paging']['ControllerPost']['page'], 1); $this->assertEqual($results, array(1, 2, 3)); + + } + + function testDefaultPaginateParams() { + $Controller =& new Controller(); + $Controller->modelClass = 'ControllerPost'; + $Controller->params['url'] = array(); + $Controller->paginate = array('order' => 'ControllerPost.id DESC'); + $Controller->constructClasses(); + $results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id'); + $this->assertEqual($Controller->params['paging']['ControllerPost']['defaults']['order'], 'ControllerPost.id DESC'); + $this->assertEqual($Controller->params['paging']['ControllerPost']['options']['order'], 'ControllerPost.id DESC'); + $this->assertEqual($results, array(3, 2, 1)); } function testFlash() {