public function testAggregateInvalidPipeline() { $collection = $this->getCollection(); $pipeline = [['$invalid' => []]]; $this->setExpectedException('MongoResultException', 'Unrecognized pipeline stage name'); $collection->aggregate($pipeline); }