PhpUnitJson reports an unfinished test as error at the end
This commit is contained in:
parent
499c4cd4bb
commit
80e01a7e9e
1 changed files with 11 additions and 0 deletions
|
|
@ -40,11 +40,22 @@ class PhpUnitResultJson extends PhpUnitResult
|
|||
$this->failures = 0;
|
||||
|
||||
if ($events) {
|
||||
$started = null;
|
||||
foreach ($events as $event) {
|
||||
if (isset($event['event']) && $event['event'] == self::EVENT_TEST) {
|
||||
$this->parseTestcase($event);
|
||||
$started = null;
|
||||
} elseif (isset($event['event']) && $event['event'] == self::EVENT_TEST_START) {
|
||||
$started = $event;
|
||||
}
|
||||
}
|
||||
if ($started) {
|
||||
$event = $started;
|
||||
$event['status'] = 'error';
|
||||
$event['message'] = 'Test is not finished';
|
||||
$event['output'] = '';
|
||||
$this->parseTestcase($event);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue