public function testInsertCallsMongoDBInsertWithMongoIdAsArgument() { $collectionName = 'users'; $values = $this->getUserValues(array('id' => 1)); $this->collectionMock->expects($this->once())->method('insert')->with($values); $this->collectionMock->expects($this->at(0))->method('findOne')->willReturn(array($collectionName => 1)); $this->connection->insert($collectionName, $values); }