function ResultPrinter::printTestsWithErrors
1 call to ResultPrinter::printTestsWithErrors()
- ResultPrinter::print in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ResultPrinter.php
File
-
vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ResultPrinter.php, line 233
Class
- ResultPrinter
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\TextUI\Output\DefaultCode
private function printTestsWithErrors(TestResult $result) : void {
if (!$result->hasTestErroredEvents()) {
return;
}
$elements = [];
foreach ($result->testErroredEvents() as $event) {
if ($event instanceof BeforeFirstTestMethodErrored) {
$title = $event->testClassName();
}
else {
$title = $this->name($event->test());
}
$elements[] = [
'title' => $title,
'body' => $event->throwable()
->asString(),
];
}
$this->printListHeaderWithNumber(count($elements), 'error');
$this->printList($elements);
}