-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-816: Cleanup collections created when tests are successful #1075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -64,6 +68,10 @@ public function setUp(): void | |||
|
|||
public function tearDown(): void | |||
{ | |||
if (! $this->hasFailed()) { | |||
$this->cleanupCollections(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overriding the tearDown
method in child classes is no longer necessary: the collection will be automagically dropped when the test calls createCollection
or dropCollection
.
c5db761
to
bef00b3
Compare
8583847
to
0873458
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor suggestions, which you can address on your own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One very minor question but LGTM.
Great work on this 🎉
Fix PHPLIB-816
FunctionalTestCase::createCollection
andFunctionalTestCase::dropCollection
to accept a different database and collection name.