A failure occurred.
PHPUnit_Framework_Test $test:
PHPUnit_Framework_AssertionFailedError $e:
float $time:
Overrides PHPUnit_Framework_TestListener::addFailure
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
$this
->writeNotOk($test, 'Failure');
$message = explode("\n", PHPUnit_Framework_TestFailure::exceptionToString($e));
$diagnostic = array(
'message' => $message[0],
'severity' => 'fail',
);
if ($e instanceof PHPUnit_Framework_ExpectationFailedException) {
$cf = $e
->getComparisonFailure();
if ($cf !== NULL) {
$diagnostic['data'] = array(
'got' => $cf
->getActual(),
'expected' => $cf
->getExpected(),
);
}
}
$yaml = new Symfony\Component\Yaml\Dumper();
$this
->write(sprintf(" ---\n%s ...\n", $yaml
->dump($diagnostic, 2, 2)));
}