Commit a46f70bf authored by Katherine Walker's avatar Katherine Walker

Add testResultIncludesTimingWithVerboseOption()

parent ffc47d4f
......@@ -95,6 +95,23 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$this->assertNotEmpty($result->getCounts());
}
public function testResultIncludesTimingWithVerboseOption()
{
$this->createFixtures(3);
$map = new Javascript('function() { emit(this.x, this.y); }');
$reduce = new Javascript('function(key, values) { return Array.sum(values); }');
$out = ['inline' => 1];
$operation = new MapReduce($this->getDatabaseName(), $this->getCollectionName(), $map, $reduce, $out, ['verbose' => true]);
$result = $operation->execute($this->getPrimaryServer());
$this->assertInstanceOf('MongoDB\MapReduceResult', $result);
$this->assertGreaterThanOrEqual(0, $result->getExecutionTimeMS());
$this->assertNotEmpty($result->getCounts());
$this->assertNotEmpty($result->getTiming());
}
public function testResultDoesNotIncludeTimingWithoutVerboseOption()
{
$this->createFixtures(3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment