diff --git a/tests/FunctionalTestCase.php b/tests/FunctionalTestCase.php index 483823faa..dc0a9d0ae 100644 --- a/tests/FunctionalTestCase.php +++ b/tests/FunctionalTestCase.php @@ -17,7 +17,6 @@ use MongoDB\Operation\DatabaseCommand; use MongoDB\Operation\ListCollections; use stdClass; -use Throwable; use UnexpectedValueException; use function array_intersect_key; @@ -70,15 +69,12 @@ public function setUp(): void $this->configuredFailPoints = []; } - protected function onNotSuccessfulTest(Throwable $t): never - { - $this->cleanupCollections(); - - throw $t; - } - public function tearDown(): void { + if ($this->status()->isSuccess()) { + $this->cleanupCollections(); + } + $this->disableFailPoints(); parent::tearDown();