protected function tearDown() { if (!self::$supported) { return; } parent::tearDown(); $this->client->dropDatabase(self::DATABASE_NAME); }
/** * Drop the test database after each test */ public function tearDown() { if (class_exists('MongoDB\\Client')) { $client = new MongoClient(); $client->dropDatabase($this->databaseName); } parent::tearDown(); }
/** * @param string $databaseName * @return array - command result */ public static function dropDB($databaseName) { return static::$_mongoClient->dropDatabase($databaseName); }
public function dropDatabase($name) { /** @var BSONDocument $result */ $result = $this->client->dropDatabase($name); return $result['ok'] == 1; }
public function dropDatabase($databaseName, $options = []) { if ($this->client->dropDatabase($databaseName, $options)) { unset($this->dbs[$databaseName]); } }