Skip to content

Commit

Permalink
Fix drop collections when it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Sep 18, 2024
1 parent 3f65868 commit 71c313e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/GridFS/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace MongoDB\Tests\GridFS;

use MongoDB\Collection;
use MongoDB\Driver\Command;
use MongoDB\GridFS\Bucket;
use MongoDB\Operation\DropCollection;
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;

use function fopen;
Expand Down Expand Up @@ -53,8 +53,9 @@ public function tearDown(): void
public static function dropCollectionsBeforeAfterClass(): void
{
$manager = static::createTestManager();
$manager->executeCommand(self::getDatabaseName(), new Command(['drop' => 'fs.chunks']));
$manager->executeCommand(self::getDatabaseName(), new Command(['drop' => 'fs.files']));

(new DropCollection(self::getDatabaseName(), 'fs.chunks'))->execute($manager->selectServer());
(new DropCollection(self::getDatabaseName(), 'fs.files'))->execute($manager->selectServer());
}

/**
Expand Down

0 comments on commit 71c313e

Please sign in to comment.