Skip to content

Commit 0365984

Browse files
committed
Remove collections before and after class, to ensure we always have the same clean setup
1 parent e318798 commit 0365984

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/GridFS/FunctionalTestCase.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ public function tearDown(): void
4242
parent::tearDown();
4343
}
4444

45-
public static function tearDownAfterClass(): void
45+
/**
46+
* The bucket's collections are created by the first test that runs and
47+
* kept for all subsequent tests. This is done to avoid creating the
48+
* collections and their indexes for each test, which would be slow.
49+
*
50+
* @beforeClass
51+
* @afterClass
52+
*/
53+
public static function dropCollectionsBeforeAfterClass(): void
4654
{
4755
$manager = static::createTestManager();
4856
$manager->executeCommand(self::getDatabaseName(), new Command(['drop' => 'fs.chunks']));
4957
$manager->executeCommand(self::getDatabaseName(), new Command(['drop' => 'fs.files']));
50-
51-
parent::tearDownAfterClass();
5258
}
5359

5460
/**

0 commit comments

Comments
 (0)