Skip to content

Commit e8b7895

Browse files
committed
Adapt aggregate explain checks to new response format
1 parent c8365ae commit e8b7895

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/Operation/AggregateFunctionalTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,17 @@ function() use ($pipeline, $options) {
217217
$results = iterator_to_array($operation->execute($this->getPrimaryServer()));
218218

219219
$this->assertCount(1, $results);
220-
$this->assertObjectHasAttribute('stages', current($results));
220+
$result = current($results);
221+
222+
if ($this->isShardedCluster()) {
223+
$this->assertObjectHasAttribute('shards', $result);
224+
225+
foreach ($result->shards as $shard) {
226+
$this->assertObjectHasAttribute('stages', $shard);
227+
}
228+
} else {
229+
$this->assertObjectHasAttribute('stages', $result);
230+
}
221231
},
222232
function(array $event) {
223233
$this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());

0 commit comments

Comments
 (0)