Skip to content

Commit

Permalink
Micro optimize TestRunner->runTestWithTimeout()
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and sebastianbergmann committed Mar 12, 2024
1 parent c571df3 commit a3ce296
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Framework/TestRunner.php
Expand Up @@ -420,12 +420,13 @@ private function shouldTimeLimitBeEnforced(TestCase $test): bool
private function runTestWithTimeout(TestCase $test): bool
{
$_timeout = $this->configuration->defaultTimeLimit();
$testSize = $test->size();

if ($test->size()->isSmall()) {
if ($testSize->isSmall()) {
$_timeout = $this->configuration->timeoutForSmallTests();
} elseif ($test->size()->isMedium()) {
} elseif ($testSize->isMedium()) {
$_timeout = $this->configuration->timeoutForMediumTests();
} elseif ($test->size()->isLarge()) {
} elseif ($testSize->isLarge()) {
$_timeout = $this->configuration->timeoutForLargeTests();
}

Expand Down

0 comments on commit a3ce296

Please sign in to comment.