mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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
This commit is contained in:
parent
27ebe79d6f
commit
2071ae1656
1 changed files with 13 additions and 0 deletions
|
@ -101,6 +101,19 @@ class ControllerTest extends CakeTestCase {
|
||||||
$results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id');
|
$results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id');
|
||||||
$this->assertEqual($Controller->params['paging']['ControllerPost']['page'], 1);
|
$this->assertEqual($Controller->params['paging']['ControllerPost']['page'], 1);
|
||||||
$this->assertEqual($results, array(1, 2, 3));
|
$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() {
|
function testFlash() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue