Skip to content

Commit 992f4ae

Browse files
committed
PHPLIB-1659: Fix dropping collections after successful tests
cb33c1c introduced onNotSuccessfulTest(), but that is the inverse logic. The internal TestCase::status() method seems to be the only replacement for TestCase::hasFailed(), which was removed in PHPUnit 10.
1 parent 08acec8 commit 992f4ae

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/FunctionalTestCase.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,12 @@ public function setUp(): void
7070
$this->configuredFailPoints = [];
7171
}
7272

73-
protected function onNotSuccessfulTest(Throwable $t): never
74-
{
75-
$this->cleanupCollections();
76-
77-
throw $t;
78-
}
79-
8073
public function tearDown(): void
8174
{
75+
if ($this->status()->isSuccess()) {
76+
$this->cleanupCollections();
77+
}
78+
8279
$this->disableFailPoints();
8380

8481
parent::tearDown();

0 commit comments

Comments
 (0)