diff --git a/src/TimeProfiler.php b/src/TimeProfiler.php index 754980a..f7ada16 100644 --- a/src/TimeProfiler.php +++ b/src/TimeProfiler.php @@ -28,8 +28,10 @@ public function stopTimeProfiler($event) { $now = round(microtime(true) * 1000); $diff = $now - self::$last_time; - if ( $diff > self::$max_time) { - echo "{$event->getScenario()->getFile()}:{$event->getScenario()->getLine()}\n"; + if (false === isset(self::$_parameters['enableCodeCoverage']) && $diff > self::$max_time) { + if (get_class($event) !== 'Behat\Behat\Event\OutlineExampleEvent') { + echo "{$event->getScenario()->getFile()}:{$event->getScenario()->getLine()}\n"; + } throw new PendingException("Request too long {$diff}ms > " . self::$max_time . "ms \n"); } }