protected function tearDown()
 {
     if (!self::$supported) {
         return;
     }
     parent::tearDown();
     $this->client->dropDatabase(self::DATABASE_NAME);
 }
Exemplo n.º 2
0
 /**
  * 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);
 }
Exemplo n.º 4
0
 public function dropDatabase($name)
 {
     /** @var BSONDocument $result */
     $result = $this->client->dropDatabase($name);
     return $result['ok'] == 1;
 }
Exemplo n.º 5
0
 public function dropDatabase($databaseName, $options = [])
 {
     if ($this->client->dropDatabase($databaseName, $options)) {
         unset($this->dbs[$databaseName]);
     }
 }