allure-framework / allure-phpunit

Allure integrations for PHP test frameworks: PHPUnit
https://allurereport.org/
Apache License 2.0
60 stars 28 forks source link

Attributes are not read from test methods with data providers #98

Closed remorhaz closed 11 months ago

remorhaz commented 11 months ago

Describe the bug When test method has data provider, test has "Unknown test" name and no dataset in the report.

To Reproduce Write following test:

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Qameta\Allure\Attribute\DisplayName;

class MyTest extends TestCase {
    #[DataProvider('providerMy'), DisplayName('My test')]
    public function testMy(int $x, int $y): void
    {
        self::assertSame($x, $y);
    }

    public static function providerMy(): iterable
    {
        return [
            "My data set" => [1, 1],
        ];
    }
}

This test will be named as "Unknown test" and without dataset in the report.

Expected behavior This test should be named as "My test" with dataset "My data set" in the report.

Additional context Problem occurs with v3.0.0.