Skip to content

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

Merged
sebastianbergmann merged 2 commits intosebastianbergmann:10.5from
6b7562617765726c6f73:fix_duplicated_data_provider_key
Apr 19, 2024
Merged

Duplicate keys from different data providers are not handled properly#5819
sebastianbergmann merged 2 commits intosebastianbergmann:10.5from
6b7562617765726c6f73:fix_duplicated_data_provider_key

Conversation

@kubawerlos
Copy link
Copy Markdown
Contributor

@kubawerlos kubawerlos commented Apr 17, 2024

No description provided.

@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
@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
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature/data-provider Data Providers type/bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants