| Q |
A |
| PHPUnit version |
9.6.15 and 10.4.2 |
| PHP version |
8.2.9 |
| Installation Method |
Composer |
Summary
In PHPUnit 10, when run with the --teamcity flag, the ##teamcity[testStarted output in locationHint is missing the with data set #{num} part that was present in PHPUnit 9.
Current behavior
##teamcity[testStarted name='testMethod with data set #0' locationHint='php_qn:///Users/Petr.Makhnev/phpunit_teamcity/SimpleDataProviderTest.php::\SimpleDataProviderTest::testMethod' flowId='36370']
Compared with PHPUnit 9:
##teamcity[testStarted name='testMethod with data set #3185 locationHint='php_qn:///Users/Petr.Makhnev/phpunit_teamcity/SimpleDataProviderTest.php::\SimpleDataProviderTest::testMethod
- with data set #0'
flowId='36509']
How to reproduce
SimpleDataProviderTest.php
<?php
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
class SimpleDataProviderTest extends TestCase
{
#[DataProvider("providePlainData")]
function testMethod($value, $expected)
{
self::assertEquals($expected, $value);
}
public static function providePlainData(): array
{
return [
1 => array(0, 2), 2 => array(0, 3), 3 => array(0, 4),
];
}
}
Run:
./vendor/bin/phpunit . --teamcity
Expected behavior
##teamcity[testStarted name='testMethod with data set #3185 locationHint='php_qn:///Users/Petr.Makhnev/phpunit_teamcity/SimpleDataProviderTest.php::\SimpleDataProviderTest::testMethod
+with data set #0'
flowId='36509']
Impact
This issue prevents PhpStorm from navigating to specific failed datasets in PHPUnit 10.
Summary
In PHPUnit 10, when run with the
--teamcityflag, the##teamcity[testStartedoutput inlocationHintis missing thewith data set #{num}part that was present in PHPUnit 9.Current behavior
Compared with PHPUnit 9:
How to reproduce
SimpleDataProviderTest.php
Run:
Expected behavior
Impact
This issue prevents PhpStorm from navigating to specific failed datasets in PHPUnit 10.