mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
drop collection test
This commit is contained in:
1 parent
9866866026
commit
e106e5a017
3 files changed
+10
-1703
No files matched your search
Generated
+1
-1700
File diff suppressed because it is too large.
Load diff
+4
-3
@@ -263,14 +263,15 @@ class MongoClient
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $options
|
||||
* @return bool
|
||||
*/
|
||||
public function dropCollection(string $name, array $options = []): MongoClient
|
||||
public function dropCollection(string $name, array $options = []): bool
|
||||
{
|
||||
$this->query(array_merge([
|
||||
$res = $this->query(array_merge([
|
||||
'drop' => $name,
|
||||
], $options));
|
||||
|
||||
return $this;
|
||||
return $res->ok === 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,8 +39,13 @@ class MongoTest extends TestCase
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws Duplicate
|
||||
*/
|
||||
public function testCreateCollection()
|
||||
{
|
||||
self::assertTrue($this->getDatabase()->createCollection('movies'));
|
||||
self::assertTrue($this->getDatabase()->dropCollection('movies'));
|
||||
self::assertTrue($this->getDatabase()->createCollection('movies'));
|
||||
self::expectException(Duplicate::class);
|
||||
self::assertTrue($this->getDatabase()->createCollection('movies'));
|
||||
|
||||
Reference in new issue
Block a user