Skip to content

Commit a3ce296

Browse files
staabmsebastianbergmann
authored andcommitted
Micro optimize TestRunner->runTestWithTimeout()
1 parent c571df3 commit a3ce296

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Framework/TestRunner.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,13 @@ private function shouldTimeLimitBeEnforced(TestCase $test): bool
420420
private function runTestWithTimeout(TestCase $test): bool
421421
{
422422
$_timeout = $this->configuration->defaultTimeLimit();
423+
$testSize = $test->size();
423424

424-
if ($test->size()->isSmall()) {
425+
if ($testSize->isSmall()) {
425426
$_timeout = $this->configuration->timeoutForSmallTests();
426-
} elseif ($test->size()->isMedium()) {
427+
} elseif ($testSize->isMedium()) {
427428
$_timeout = $this->configuration->timeoutForMediumTests();
428-
} elseif ($test->size()->isLarge()) {
429+
} elseif ($testSize->isLarge()) {
429430
$_timeout = $this->configuration->timeoutForLargeTests();
430431
}
431432

0 commit comments

Comments
 (0)