Doctrine\MongoDB\Tests\Query\QueryTest::testMapReduceOptionsArePassed PHP Method

testMapReduceOptionsArePassed() public method

    public function testMapReduceOptionsArePassed()
    {
        $map = 'function() { emit(this.a, 1); }';
        $reduce = 'function(key, values) { return Array.sum(values); }';
        $queryArray = ['type' => Query::TYPE_MAP_REDUCE, 'mapReduce' => ['map' => $map, 'reduce' => $reduce, 'out' => 'collection', 'options' => ['jsMode' => true]], 'limit' => 10, 'query' => ['type' => 1]];
        $collection = $this->getMockCollection();
        $collection->expects($this->once())->method('mapReduce')->with($map, $reduce, 'collection', ['type' => 1], ['limit' => 10, 'jsMode' => true]);
        $query = new Query($collection, $queryArray, []);
        $query->execute();
    }