/** * {@inheritdoc} */ protected function tearDown() { if ($this->dm) { foreach ($this->dm->getDocumentDatabases() as $db) { foreach ($db->listCollections() as $collection) { $collection->drop(); } } $this->dm->getConnection()->close(); $this->dm = null; } }