Prevent undefined errors in TapParser if output from scripts failed.
Closes #515
This commit is contained in:
parent
71ce377352
commit
0b8b2fd364
1 changed files with 3 additions and 2 deletions
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue