function ResultPrinter::mapTestsWithIssuesEventsToElements
@psalm-param array<string,list<ConsideredRisky|DeprecationTriggered|PhpDeprecationTriggered|PhpunitDeprecationTriggered|ErrorTriggered|NoticeTriggered|PhpNoticeTriggered|WarningTriggered|PhpWarningTriggered|PhpunitErrorTriggered|PhpunitWarningTriggered>> $events
@psalm-return array{numberOfTestsWithIssues: int, numberOfIssues: int, elements: list<array{title: string, body: string}>}
4 calls to ResultPrinter::mapTestsWithIssuesEventsToElements()
- ResultPrinter::printDetailsOnTestsThatTriggeredPhpunitDeprecations in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ResultPrinter.php - ResultPrinter::printDetailsOnTestsThatTriggeredPhpunitWarnings in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ResultPrinter.php - ResultPrinter::printPhpunitErrors in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ResultPrinter.php - ResultPrinter::printRiskyTests in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ResultPrinter.php
File
-
vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ResultPrinter.php, line 526
Class
- ResultPrinter
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\TextUI\Output\DefaultCode
private function mapTestsWithIssuesEventsToElements(array $events) : array {
$elements = [];
$issues = 0;
foreach ($events as $reasons) {
$test = $reasons[0]->test();
$testLocation = $this->testLocation($test);
$title = $this->name($test);
$body = '';
$first = true;
$single = count($reasons) === 1;
foreach ($reasons as $reason) {
if ($first) {
$first = false;
}
else {
$body .= PHP_EOL;
}
$body .= $this->reasonMessage($reason, $single);
$body .= $this->reasonLocation($reason, $single);
$issues++;
}
if (!empty($testLocation)) {
$body .= $testLocation;
}
$elements[] = [
'title' => $title,
'body' => $body,
];
}
return [
'numberOfTestsWithIssues' => count($events),
'numberOfIssues' => $issues,
'elements' => $elements,
];
}