/** * Check if process is not running longer then specified timeout, return error message if so. * @param Process $process Process instance * @param string $testClass Name of tested class * @return string|null Error message if process timeout exceeded */ protected function checkProcessTimeout(Process $process, $testClass) { try { $process->checkTimeout(); } catch (ProcessTimedOutException $e) { return sprintf('[%s]: Process for class "%s" exceeded the time out of %d seconds and was killed.', date("Y-m-d H:i:s"), $testClass, $e->getExceededTimeout()); } }