Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
remorhaz opened this issue Nov 10, 2023 · 0 comments · Fixed by #99
Closed

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

remorhaz opened this issue Nov 10, 2023 · 0 comments · Fixed by #99

Comments

@remorhaz
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant