Skip to content

Warn when #[DataProvider*] attributes are mixed with #[TestWith*] attributes #6273

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

Merged

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jul 13, 2025

closes #6265

@staabm staabm marked this pull request as ready for review July 13, 2025 09:31
MetadataCollection::fromArray([]),
Event\TestData\TestDataCollection::fromArray([]),
),
'Mixing #[DataProvider] and #[TestWith] attributes is not supported, only the data provided by #[DataProvider] will be used',
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be confusing when using DataProviderExternal or TestWithJson. The message should probably deal better with such cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, didn't think about all these other types of providers. will adjust the wording.

@staabm staabm force-pushed the warn-mixed-dataprovider branch from f17a6a0 to 0e5d604 Compare July 25, 2025 08:40
@staabm staabm force-pushed the warn-mixed-dataprovider branch from 0e5d604 to cda60ae Compare July 29, 2025 13:49
@sebastianbergmann sebastianbergmann added type/enhancement A new idea that should be implemented feature/test-runner CLI test runner feature/data-provider Data Providers labels Jul 30, 2025
@sebastianbergmann sebastianbergmann added this to the PHPUnit 12.3 milestone Jul 30, 2025
@sebastianbergmann sebastianbergmann merged commit 31cc9d3 into sebastianbergmann:main Jul 30, 2025
25 checks passed
@sebastianbergmann sebastianbergmann changed the title Warn on mix of different data providers Warn when #[DataProvider*] attributes are mixed with #[TestWith*] attributes Jul 30, 2025
@staabm staabm deleted the warn-mixed-dataprovider branch July 30, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/data-provider Data Providers feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DX: error on mix of different dataprovider types
3 participants