Improves test case name styling

This commit is contained in:
luke
2021-07-16 17:50:18 +01:00
parent 5f315fc899
commit 9516e56242

View File

@ -37,7 +37,12 @@ final class TeamCity extends DefaultResultPrinter
/** @var \PHPUnit\Util\Log\TeamCity */ /** @var \PHPUnit\Util\Log\TeamCity */
private $phpunitTeamCity; private $phpunitTeamCity;
/** @var array<callable> */ /**
* A stack of error messages and test failures to be displayed
* once the test suite has finished running.
*
* @var array<callable>
*/
protected $outputStack = []; protected $outputStack = [];
public function __construct(bool $verbose, string $colors) public function __construct(bool $verbose, string $colors)
@ -55,6 +60,9 @@ final class TeamCity extends DefaultResultPrinter
$this->logo(); $this->logo();
} }
/**
* Outputs Pest's logo and version number at the top of the output.
*/
private function logo(): void private function logo(): void
{ {
$this->writeNewLine(); $this->writeNewLine();
@ -72,7 +80,7 @@ final class TeamCity extends DefaultResultPrinter
public function startTestSuite(TestSuite $suite): void public function startTestSuite(TestSuite $suite): void
{ {
if (str_starts_with($suite->getName(), 'P\\')) { if (str_starts_with($suite->getName(), 'P\\')) {
$this->writeWithColor('bg-white, fg-black, bold', ' ' . substr_replace($suite->getName(), '', 0, 2) . ' '); $this->writeWithColor('fg-white, bold', ' ' . substr_replace($suite->getName(), '', 0, 2) . ' ');
} }
$this->flowId = (int) getmypid(); $this->flowId = (int) getmypid();