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

Duplicate keys from different data providers are not handled properly #5819

Conversation

kubawerlos
Copy link
Contributor

@kubawerlos kubawerlos commented Apr 17, 2024

No description provided.

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.28%. Comparing base (c726f0d) to head (70dd63a).

Additional details and impacted files
@@             Coverage Diff              @@
##               10.5    #5819      +/-   ##
============================================
- Coverage     90.28%   90.28%   -0.01%     
+ Complexity     6441     6439       -2     
============================================
  Files           679      679              
  Lines         19545    19540       -5     
============================================
- Hits          17647    17642       -5     
  Misses         1898     1898              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kubawerlos kubawerlos marked this pull request as ready for review April 17, 2024 18:32
@sebastianbergmann
Copy link
Owner

I am sorry to ask, but from looking at the patch it is not yet clear to me what issue this PR aims to solve. Can you enlighten me? Thanks!

@sebastianbergmann sebastianbergmann added type/bug Something is broken feature/data-provider Data Providers labels Apr 18, 2024
@kubawerlos
Copy link
Contributor Author

kubawerlos commented Apr 18, 2024

@sebastianbergmann currently if you run DuplicateKeyDataProvidersTest the result will be:

OK (1 test, 1 assertion)

(you can see the result of DataProvider::providedData in the 1st commit)
when:

  • there are 2 tests
  • what's more important: dataProvider1 provides a test case that should fail, but unfortunately it was overwritten by a case from dataProvider2, due to key duplication.

Also, the changes in DataProvider, as they are technically a bug fix, they are more simplification (it is better visible as of https://github.com/sebastianbergmann/phpunit/pull/5819/files?w=1) - it is getting rid of the additional $origData variable and calling array_merge.

@sebastianbergmann sebastianbergmann merged commit 1e82280 into sebastianbergmann:10.5 Apr 19, 2024
31 checks passed
@sebastianbergmann sebastianbergmann changed the title Fix reporting duplicated key from data providers in test Duplicate keys from different data providers are not handled properly Apr 19, 2024
@kubawerlos kubawerlos deleted the fix_duplicated_data_provider_key branch April 19, 2024 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/data-provider Data Providers type/bug Something is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants