mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +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 Pest\Concerns\Testable;
|
||||||
use PHPUnit\Framework\AssertionFailedError;
|
use PHPUnit\Framework\AssertionFailedError;
|
||||||
use PHPUnit\Framework\Test;
|
use PHPUnit\Framework\Test;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
use PHPUnit\Framework\TestResult;
|
use PHPUnit\Framework\TestResult;
|
||||||
use PHPUnit\Framework\TestSuite;
|
use PHPUnit\Framework\TestSuite;
|
||||||
use PHPUnit\Framework\Warning;
|
use PHPUnit\Framework\Warning;
|
||||||
|
use PHPUnit\Runner\PhptTestCase;
|
||||||
use PHPUnit\TextUI\DefaultResultPrinter;
|
use PHPUnit\TextUI\DefaultResultPrinter;
|
||||||
use function round;
|
use function round;
|
||||||
use function str_replace;
|
use function str_replace;
|
||||||
@ -137,6 +139,12 @@ final class TeamCity extends DefaultResultPrinter
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($test instanceof TestCase) {
|
||||||
|
$this->numAssertions += $test->getNumAssertions();
|
||||||
|
} elseif ($test instanceof PhptTestCase) {
|
||||||
|
$this->numAssertions++;
|
||||||
|
}
|
||||||
|
|
||||||
$this->printEvent('testFinished', [
|
$this->printEvent('testFinished', [
|
||||||
self::NAME => $test->getName(),
|
self::NAME => $test->getName(),
|
||||||
self::DURATION => self::toMilliseconds($time),
|
self::DURATION => self::toMilliseconds($time),
|
||||||
|
|||||||
Reference in New Issue
Block a user