diff --git a/src/Logging/TeamCity.php b/src/Logging/TeamCity.php index fded41e4..14704aab 100644 --- a/src/Logging/TeamCity.php +++ b/src/Logging/TeamCity.php @@ -8,9 +8,11 @@ use function getmypid; use Pest\Concerns\Testable; use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\Test; +use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestResult; use PHPUnit\Framework\TestSuite; use PHPUnit\Framework\Warning; +use PHPUnit\Runner\PhptTestCase; use PHPUnit\TextUI\DefaultResultPrinter; use function round; use function str_replace; @@ -137,6 +139,12 @@ final class TeamCity extends DefaultResultPrinter return; } + if ($test instanceof TestCase) { + $this->numAssertions += $test->getNumAssertions(); + } elseif ($test instanceof PhptTestCase) { + $this->numAssertions++; + } + $this->printEvent('testFinished', [ self::NAME => $test->getName(), self::DURATION => self::toMilliseconds($time),