Skip to content

Name of data set is missing from TeamCity output #5621

Description

@i582
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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions