Skip to content

Commit

Permalink
Fix failing code in PaginatorComponent.
Browse files Browse the repository at this point in the history
Instead of execute(), all() should be used now.
  • Loading branch information
markstory committed Dec 30, 2013
1 parent 2af4166 commit 20e9fd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cake/Controller/Component/PaginatorComponent.php
Expand Up @@ -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);
Expand Down
Expand Up @@ -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())
Expand Down

0 comments on commit 20e9fd2

Please sign in to comment.