function TestRunner::runTestWithTimeout
Throws
Throwable
1 call to TestRunner::runTestWithTimeout()
- TestRunner::run in vendor/
phpunit/ phpunit/ src/ Framework/ TestRunner.php
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ TestRunner.php, line 415
Class
- TestRunner
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\FrameworkCode
private function runTestWithTimeout(TestCase $test) : bool {
$_timeout = $this->configuration
->defaultTimeLimit();
$testSize = $test->size();
if ($testSize->isSmall()) {
$_timeout = $this->configuration
->timeoutForSmallTests();
}
elseif ($testSize->isMedium()) {
$_timeout = $this->configuration
->timeoutForMediumTests();
}
elseif ($testSize->isLarge()) {
$_timeout = $this->configuration
->timeoutForLargeTests();
}
try {
(new Invoker())->invoke([
$test,
'runBare',
], [], $_timeout);
} catch (TimeoutException) {
Event\Facade::emitter()->testConsideredRisky($test->valueObjectForEvents(), sprintf('This test was aborted after %d second%s', $_timeout, $_timeout !== 1 ? 's' : ''));
return true;
}
return false;
}