diff --git a/PHPCI/Plugin/Util/TapParser.php b/PHPCI/Plugin/Util/TapParser.php index 1aa25348..a18e89e5 100644 --- a/PHPCI/Plugin/Util/TapParser.php +++ b/PHPCI/Plugin/Util/TapParser.php @@ -44,7 +44,7 @@ class TapParser throw new \Exception('TapParser only supports TAP version 13'); } - if (preg_match(self::TEST_COVERAGE_PATTERN, $lines[count($lines) - 1])) { + if (isset($lines[count($lines) - 1]) && preg_match(self::TEST_COVERAGE_PATTERN, $lines[count($lines) - 1])) { array_pop($lines); if ($lines[count($lines) - 1] == "") { array_pop($lines); @@ -58,7 +58,8 @@ class TapParser $totalTests = (int) $matches[2]; } - if (preg_match(self::TEST_COUNTS_PATTERN, $lines[count($lines) - 1], $matches)) { + if (isset($lines[count($lines) - 1]) && + preg_match(self::TEST_COUNTS_PATTERN, $lines[count($lines) - 1], $matches)) { array_pop($lines); $totalTests = (int) $matches[2]; }