Navigation Menu

Skip to content

Commit

Permalink
Updating tests having calls to mapReduce to account for new parameter
Browse files Browse the repository at this point in the history
order
  • Loading branch information
lorenzo committed Dec 31, 2013
1 parent 5daddf3 commit 213f0e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Cake/Test/TestCase/ORM/QueryTest.php
Expand Up @@ -1051,14 +1051,14 @@ public function testResultsAreWrappedInMapReduce() {
->method('execute')
->will($this->returnValue($statement));

$query->mapReduce(function($k, $v, $mr) {
$query->mapReduce(function($v, $k, $mr) {
$mr->emit($v['a']);
});
$query->mapReduce(
function($k, $v, $mr) {
$mr->emitIntermediate($k, $v);
function($v, $k, $mr) {
$mr->emitIntermediate($v, $k);
},
function($k, $v, $mr) {
function($v, $k, $mr) {
$mr->emit($v[0] + 1);
}
);
Expand Down Expand Up @@ -1118,10 +1118,10 @@ public function testFirstSameResult() {
* @return void
*/
public function testFirstMapReduce() {
$map = function($key, $row, $mapReduce) {
$mapReduce->emitIntermediate('id', $row['id']);
$map = function($row, $key, $mapReduce) {
$mapReduce->emitIntermediate($row['id'], 'id');
};
$reduce = function($key, $values, $mapReduce) {
$reduce = function($values, $key, $mapReduce) {
$mapReduce->emit(array_sum($values));
};

Expand Down

0 comments on commit 213f0e8

Please sign in to comment.