public function PHPUnit_Framework_TestResult::addFailure in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/Framework/TestResult.php \PHPUnit_Framework_TestResult::addFailure()
Adds a failure to the list of failures. The passed in exception caused the failure.
Parameters
PHPUnit_Framework_Test $test:
PHPUnit_Framework_AssertionFailedError $e:
float $time:
1 call to PHPUnit_Framework_TestResult::addFailure()
- PHPUnit_Framework_TestResult::run in vendor/
phpunit/ phpunit/ src/ Framework/ TestResult.php - Runs a TestCase.
File
- vendor/
phpunit/ phpunit/ src/ Framework/ TestResult.php, line 243
Class
- PHPUnit_Framework_TestResult
- A TestResult collects the results of executing a test case.
Code
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
if ($e instanceof PHPUnit_Framework_RiskyTest || $e instanceof PHPUnit_Framework_OutputError) {
$this->risky[] = new PHPUnit_Framework_TestFailure($test, $e);
$notifyMethod = 'addRiskyTest';
if ($this->stopOnRisky) {
$this
->stop();
}
}
elseif ($e instanceof PHPUnit_Framework_IncompleteTest) {
$this->notImplemented[] = new PHPUnit_Framework_TestFailure($test, $e);
$notifyMethod = 'addIncompleteTest';
if ($this->stopOnIncomplete) {
$this
->stop();
}
}
elseif ($e instanceof PHPUnit_Framework_SkippedTest) {
$this->skipped[] = new PHPUnit_Framework_TestFailure($test, $e);
$notifyMethod = 'addSkippedTest';
if ($this->stopOnSkipped) {
$this
->stop();
}
}
else {
$this->failures[] = new PHPUnit_Framework_TestFailure($test, $e);
$notifyMethod = 'addFailure';
if ($this->stopOnFailure) {
$this
->stop();
}
}
foreach ($this->listeners as $listener) {
$listener
->{$notifyMethod}($test, $e, $time);
}
$this->lastTestFailed = true;
$this->time += $time;
}