mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Merge pull request #349 from pestphp/teamcity-assertion-fix
Fixes the assertion output showing as 0 in the TeamCity logger
This commit is contained in:
@ -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),
|
||||
|
||||
Reference in New Issue
Block a user