Skip to content

Commit 71c313e

Browse files
committed
Fix drop collections when it doesn't exist
1 parent 3f65868 commit 71c313e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/GridFS/FunctionalTestCase.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace MongoDB\Tests\GridFS;
44

55
use MongoDB\Collection;
6-
use MongoDB\Driver\Command;
76
use MongoDB\GridFS\Bucket;
7+
use MongoDB\Operation\DropCollection;
88
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
99

1010
use function fopen;
@@ -53,8 +53,9 @@ public function tearDown(): void
5353
public static function dropCollectionsBeforeAfterClass(): void
5454
{
5555
$manager = static::createTestManager();
56-
$manager->executeCommand(self::getDatabaseName(), new Command(['drop' => 'fs.chunks']));
57-
$manager->executeCommand(self::getDatabaseName(), new Command(['drop' => 'fs.files']));
56+
57+
(new DropCollection(self::getDatabaseName(), 'fs.chunks'))->execute($manager->selectServer());
58+
(new DropCollection(self::getDatabaseName(), 'fs.files'))->execute($manager->selectServer());
5859
}
5960

6061
/**

0 commit comments

Comments
 (0)