Skip to content
Permalink
Browse files

Fix failing code in PaginatorComponent.

Instead of execute(), all() should be used now.
  • Loading branch information...
markstory committed Dec 30, 2013
1 parent 2af4166 commit 20e9fd2c9729df350a516bc5995877707b01e173
@@ -164,7 +164,7 @@ public function paginate($object, array $settings = []) {
$parameters = compact('conditions', 'fields', 'order', 'limit', 'page');
$query = $object->find($type, array_merge($parameters, $extra));
$results = $query->execute();
$results = $query->all();
$numResults = count($results);
$defaults = $this->getDefaults($alias, $settings);
@@ -722,15 +722,15 @@ protected function _getMockPosts($methods = []) {
* @return Query
*/
protected function _getMockFindQuery() {
$query = $this->getMock('Cake\ORM\Query', ['total', 'execute'], [], '', false);
$query = $this->getMock('Cake\ORM\Query', ['total', 'all'], [], '', false);
$results = $this->getMock('Cake\ORM\ResultSet', [], [], '', false);
$results->expects($this->any())
->method('count')
->will($this->returnValue(2));
$query->expects($this->any())
->method('execute')
->method('all')
->will($this->returnValue($results));
$query->expects($this->any())

0 comments on commit 20e9fd2

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