Skip to content

Conversation

kubawerlos
Copy link
Member

Fixes #8839

@kubawerlos kubawerlos enabled auto-merge (squash) July 15, 2025 17:16
@coveralls
Copy link

coveralls commented Jul 15, 2025

Coverage Status

coverage: 94.747% (-0.01%) from 94.76%
when pulling ff6f8eb on 6b7562617765726c6f73:fix_PhpUnitDataProviderNameFixer
into 69431f5 on PHP-CS-Fixer:master.

@@ -509,5 +509,39 @@ public function the_provider_of_the_data(): iterable {}
}
PHP,
];

yield 'multiple data providers defined by attributes for one test method' => [
<<<'PHP'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the idea is to skip the code when multi-attributes?

or we shall have test case with expected+input code snippets ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the idea is to skip the code when multi-attributes?

Always was, when we supported only PHPDocs, the if I've removed in b0aed9d was enough.

When we support attributes, we have to calculate if the relations are 1-1 between the test method and data provider, and only then fix the name.

@mvorisek
Copy link
Contributor

Thank you for looking into this ❤

@kubawerlos kubawerlos merged commit dd18f2a into PHP-CS-Fixer:master Jul 23, 2025
30 checks passed
@kubawerlos kubawerlos deleted the fix_PhpUnitDataProviderNameFixer branch July 23, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PhpUnitDataProviderNameFixer with multiple providers for one test is broken
4 participants