Skip to content
Permalink
Browse files

Fix #11655.

  • Loading branch information...
ADmad committed Jan 23, 2018
1 parent 5b92235 commit c4aedbd464077ba5d997f1baf2eb08d134e31e9c
@@ -270,7 +270,7 @@ protected function _setPagingParams()
$request->addParams([
'paging' => $this->_paginator->getPagingParams()
+ (array)$request->getParam('paging')
+ $request->getParam('paging', [])
]);
}
@@ -223,6 +223,29 @@ public function testPaginateCustomFinderOptions()
$this->assertEquals($expected, $result);
}
/**
* testRequestParamsSetting
*
* @return void
* @see https://github.com/cakephp/cakephp/issues/11655
*/
public function testRequestParamsSetting()
{
$this->loadFixtures('Posts');
$settings = [
'PaginatorPosts' => [
'limit' => 10,
]
];
$table = TableRegistry::get('PaginatorPosts');
$this->Paginator->paginate($table, $settings);
$this->assertArrayHasKey('PaginatorPosts', $this->request->params['paging']);
$this->assertArrayNotHasKey(0, $this->request->params['paging']);
}
/**
* Test that special paginate types are called and that the type param doesn't leak out into defaults or options.
*

0 comments on commit c4aedbd

Please sign in to comment.
You can’t perform that action at this time.