diff --git a/src/Logging/TeamCity.php b/src/Logging/TeamCity.php index fded41e4..c482836c 100644 --- a/src/Logging/TeamCity.php +++ b/src/Logging/TeamCity.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace Pest\Logging; +use PHPUnit\Framework\TestCase; +use PHPUnit\Runner\PhptTestCase; use function getmypid; use Pest\Concerns\Testable; use PHPUnit\Framework\AssertionFailedError; @@ -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),