8000 minor #58357 [Form] do not override the final `runTest()` method (xab… · symfony/symfony@3de6a5d · GitHub
[go: up one dir, main page]

Skip to content

Commit 3de6a5d

Browse files
minor #58357 [Form] do not override the final runTest() method (xabbuh)
This PR was merged into the 7.2 branch. Discussion ---------- [Form] do not override the final `runTest()` method | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The `runTest()` method is `final` since PHPUnit 11.0. Commits ------- e5797df do not override the final runTest() method
2 parents e927511 + e5797df commit 3de6a5d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/Symfony/Component/Form/Test/FormPerformanceTestCase.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,25 @@ abstract class FormPerformanceTestCase extends FormIntegrationTestCase
2525
{
2626
use VersionAwareTestTrait;
2727

28+
private float $startTime;
2829
protected int $maxRunningTime = 0;
2930

30-
protected function runTest(): mixed
31+
protected function setUp(): void
3132
{
32-
$s = microtime(true);
33-
$result = parent::runTest();
34-
$time = microtime(true) - $s;
33+
parent::setUp();
34+
35+
$this->startTime = microtime(true);
36+
}
37+
38+
protected function assertPostConditions(): void
39+
{
40+
parent::assertPostConditions();
41+
42+
$time = microtime(true) - $this->startTime;
3543

3644
if (0 != $this->maxRunningTime && $time > $this->maxRunningTime) {
3745
$this->fail(\sprintf('expected running time: <= %s but was: %s', $this->maxRunningTime, $time));
3846
}
39-
40-
return $result;
4147
}
4248

4349
/**

0 commit comments

Comments
 (0)
0