now take in account the errors in the codeception plugin (#1206)

This commit is contained in:
David Valdez 2016-04-27 06:10:46 -05:00 committed by Dan Cryer
parent ffa593f1a3
commit e567088a00

View file

@ -20,6 +20,7 @@ class Codeception implements ParserInterface
protected $totalTests;
protected $totalTimeTaken;
protected $totalFailures;
protected $totalErrors;
/**
* @param Builder $phpci
@ -47,6 +48,7 @@ class Codeception implements ParserInterface
$this->totalTests += (int) $testsuite['tests'];
$this->totalTimeTaken += (float) $testsuite['time'];
$this->totalFailures += (int) $testsuite['failures'];
$this->totalErrors += (int) $testsuite['errors'];
foreach ($testsuite->testcase as $testcase) {
$testresult = array(
@ -67,9 +69,9 @@ class Codeception implements ParserInterface
$testresult['feature'] = sprintf('%s::%s', $testresult['class'], $testresult['name']);
}
if (isset($testcase->failure)) {
if (isset($testcase->failure) || isset($testcase->error)) {
$testresult['pass'] = false;
$testresult['message'] = (string) $testcase->failure;
$testresult['message'] = isset($testcase->failure) ? (string) $testcase->failure : (string) $testcase->error;
} else {
$testresult['pass'] = true;
}
@ -108,6 +110,6 @@ class Codeception implements ParserInterface
*/
public function getTotalFailures()
{
return $this->totalFailures;
return $this->totalFailures + $this->totalErrors;
}
}