mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Output improvements.
This commit is contained in:
@ -59,7 +59,7 @@ final class TeamCity extends DefaultResultPrinter
|
||||
private function logo(): void
|
||||
{
|
||||
$this->writeNewLine();
|
||||
$this->write('Pest ' . version());
|
||||
$this->write('Pest '.version());
|
||||
$this->writeNewLine();
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ final class TeamCity extends DefaultResultPrinter
|
||||
});
|
||||
|
||||
foreach ($filteredResults as $key => $info) {
|
||||
$this->writeProgressWithColor($info['color'], $info['count'] . " $key");
|
||||
$this->writeProgressWithColor($info['color'], $info['count']." $key");
|
||||
|
||||
if ($key !== array_reverse(array_keys($filteredResults))[0]) {
|
||||
$this->write(', ');
|
||||
@ -118,9 +118,7 @@ final class TeamCity extends DefaultResultPrinter
|
||||
public function startTestSuite(TestSuite $suite): void
|
||||
{
|
||||
if (static::isPestTestSuite($suite)) {
|
||||
$this->writeWithColor('fg-white, bold', ' ' . substr_replace($suite->getName(), '', 0, 2) . ' ');
|
||||
} else {
|
||||
$this->writeWithColor('fg-white, bold', ' ' . $suite->getName());
|
||||
$this->writeWithColor('fg-white, bold', ' '.substr_replace($suite->getName(), '', 0, 2).' ');
|
||||
}
|
||||
|
||||
$this->flowId = (int) getmypid();
|
||||
@ -139,7 +137,7 @@ final class TeamCity extends DefaultResultPrinter
|
||||
$this->printEvent(
|
||||
self::TEST_SUITE_STARTED, [
|
||||
self::NAME => $suiteName,
|
||||
self::LOCATION_HINT => self::PROTOCOL . $suiteName,
|
||||
self::LOCATION_HINT => self::PROTOCOL.$suiteName,
|
||||
]);
|
||||
|
||||
return;
|
||||
@ -150,7 +148,7 @@ final class TeamCity extends DefaultResultPrinter
|
||||
$this->printEvent(
|
||||
self::TEST_SUITE_STARTED, [
|
||||
self::NAME => substr($suiteName, 2),
|
||||
self::LOCATION_HINT => self::PROTOCOL . $fileName,
|
||||
self::LOCATION_HINT => self::PROTOCOL.$fileName,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -196,16 +194,13 @@ final class TeamCity extends DefaultResultPrinter
|
||||
public function endTestSuite(TestSuite $suite): void
|
||||
{
|
||||
$suiteName = $suite->getName();
|
||||
|
||||
if (static::isPestTestSuite($suite)) {
|
||||
$this->writeNewLine();
|
||||
}
|
||||
|
||||
if (file_exists($suiteName) || !method_exists($suiteName, '__getFileName')) {
|
||||
$this->printEvent(
|
||||
self::TEST_SUITE_FINISHED, [
|
||||
self::NAME => $suiteName,
|
||||
self::LOCATION_HINT => self::PROTOCOL . $suiteName,
|
||||
self::LOCATION_HINT => self::PROTOCOL.$suiteName,
|
||||
]);
|
||||
|
||||
return;
|
||||
@ -215,8 +210,6 @@ final class TeamCity extends DefaultResultPrinter
|
||||
self::TEST_SUITE_FINISHED, [
|
||||
self::NAME => substr($suiteName, 2),
|
||||
]);
|
||||
|
||||
$this->writeNewLine();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -233,7 +226,7 @@ final class TeamCity extends DefaultResultPrinter
|
||||
$this->printEvent('testStarted', [
|
||||
self::NAME => $test->getName(),
|
||||
// @phpstan-ignore-next-line
|
||||
self::LOCATION_HINT => self::PROTOCOL . $test->toString(),
|
||||
self::LOCATION_HINT => self::PROTOCOL.$test->toString(),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -268,6 +261,11 @@ final class TeamCity extends DefaultResultPrinter
|
||||
$this->lastTestFailed = false;
|
||||
}
|
||||
|
||||
private static function toMilliseconds(float $time): int
|
||||
{
|
||||
return (int) round($time * 1000);
|
||||
}
|
||||
|
||||
private function writePestTestOutput(string $message, string $color, string $symbol, string $suffix = null): void
|
||||
{
|
||||
$this->writeProgressWithColor($color, "$symbol ");
|
||||
@ -279,11 +277,6 @@ final class TeamCity extends DefaultResultPrinter
|
||||
}
|
||||
}
|
||||
|
||||
private static function toMilliseconds(float $time): int
|
||||
{
|
||||
return (int) round($time * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Test|Testable $test
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user