Skip to content

Commit 673c5d6

Browse files
Refactor
1 parent efc519f commit 673c5d6

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/TextUI/Output/TestDox/ResultPrinter.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ public function print(TestResult $result, array $tests): void
7777
}
7878

7979
$this->printBeforeClassOrAfterClassErrors(
80-
'These before-first-test methods errored:',
80+
'before-first-test',
8181
$beforeFirstTestMethodErrored,
8282
);
8383

8484
$this->printBeforeClassOrAfterClassErrors(
85-
'These after-last-test methods errored:',
85+
'after-last-test',
8686
$afterLastTestMethodErrored,
8787
);
8888
}
@@ -436,18 +436,23 @@ private function symbolFor(TestStatus $status): string
436436
}
437437

438438
/**
439-
* @param non-empty-string $header
439+
* @param 'after-last-test'|'before-first-test' $type
440440
* @param array<non-empty-string, AfterLastTestMethodErrored|BeforeFirstTestMethodErrored> $errors
441441
*/
442-
private function printBeforeClassOrAfterClassErrors(string $header, array $errors): void
442+
private function printBeforeClassOrAfterClassErrors(string $type, array $errors): void
443443
{
444444
if (empty($errors)) {
445445
return;
446446
}
447447

448-
$index = 0;
448+
$this->printer->print(
449+
sprintf(
450+
'These %s methods errored:' . PHP_EOL . PHP_EOL,
451+
$type,
452+
),
453+
);
449454

450-
$this->printer->print($header . PHP_EOL . PHP_EOL);
455+
$index = 0;
451456

452457
foreach ($errors as $method => $error) {
453458
$this->printer->print(

0 commit comments

Comments
 (0)