public function getScore()
{
$score = null;
if ($this->test !== null && $this->php->isRunning() === false) {
$stdOut = $this->php->getStdout();
$score = @unserialize($stdOut);
if ($score instanceof atoum\score === false) {
$score = call_user_func($this->scoreFactory)->addUncompletedMethod($this->test->getPath(), $this->test->getClass(), $this->method, $this->php->getExitCode(), $this->php->getStdOut());
}
$stdErr = $this->php->getStderr();
if ($stdErr !== '') {
if (preg_match_all('/([^:]+): (.+) in (.+) on line ([0-9]+)/', trim($stdErr), $errors, PREG_SET_ORDER) === 0) {
$score->addError($this->test->getPath(), $this->test->getClass(), $this->method, null, 'UNKNOWN', $stdErr);
} else {
foreach ($errors as $error) {
$score->addError($this->test->getPath(), $this->test->getClass(), $this->method, null, $error[1], $error[2], $error[3], $error[4]);
}
}
}
}
return $score;
}