Skip to content

Commit

Permalink
Merge branch '11.5' into 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 6, 2025
2 parents 86e409a + 673c5d6 commit 7b512f9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/TextUI/Output/TestDox/ResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public function print(TestResult $result, array $tests): void
}

$this->printBeforeClassOrAfterClassErrors(
'These before-first-test methods errored:',
'before-first-test',
$beforeFirstTestMethodErrored,
);

$this->printBeforeClassOrAfterClassErrors(
'These after-last-test methods errored:',
'after-last-test',
$afterLastTestMethodErrored,
);
}
Expand Down Expand Up @@ -436,18 +436,23 @@ private function symbolFor(TestStatus $status): string
}

/**
* @param non-empty-string $header
* @param 'after-last-test'|'before-first-test' $type
* @param array<non-empty-string, AfterLastTestMethodErrored|BeforeFirstTestMethodErrored> $errors
*/
private function printBeforeClassOrAfterClassErrors(string $header, array $errors): void
private function printBeforeClassOrAfterClassErrors(string $type, array $errors): void
{
if (empty($errors)) {
return;
}

$index = 0;
$this->printer->print(
sprintf(
'These %s methods errored:' . PHP_EOL . PHP_EOL,
$type,
),
);

$this->printer->print($header . PHP_EOL . PHP_EOL);
$index = 0;

foreach ($errors as $method => $error) {
$this->printer->print(
Expand Down

0 comments on commit 7b512f9

Please sign in to comment.