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

Using @testWith annotation may generate PHP Warning: Uninitialized string offset 0 #5802

Merged
merged 3 commits into from
Apr 14, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 6, 2024

Closes #5795

Copy link

codecov bot commented Apr 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.15%. Comparing base (1a63f0d) to head (9f951ca).

Additional details and impacted files
@@            Coverage Diff            @@
##               10.5    #5802   +/-   ##
=========================================
  Coverage     90.15%   90.15%           
- Complexity     6440     6441    +1     
=========================================
  Files           679      679           
  Lines         19545    19545           
=========================================
  Hits          17620    17620           
  Misses         1925     1925           

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

@staabm staabm changed the title try reproducing bug5795 Using @testWith annotation may generate PHP Warning: Uninitialized string offset 0 Apr 14, 2024
@staabm staabm marked this pull request as ready for review April 14, 2024 06:37
@staabm
Copy link
Contributor Author

staabm commented Apr 14, 2024

btw: I never seen this feature used in the wild. I am not sure when to use it, if one can use a regular DataProvider instead.

writing data for tests in a phpdoc comment, which will be parsed and mangled by a lot of other tools sounds like a footgun.

@sebastianbergmann
Copy link
Owner

I never seen this feature used in the wild

Me neither.

I am not sure when to use it, if one can use a regular DataProvider instead

This was proposed in #1151 and implemented in #1728. The argument was that "[data providers are] overcomplicated and require to[o] much code for most tasks".

I should have said "No!" at the time, but did not :-(

writing data for tests in a phpdoc comment, which will be parsed and mangled by a lot of other tools sounds like a footgun

At least this footgun will be gone once support for annotations in comments is removed.

@sebastianbergmann sebastianbergmann merged commit 75709ca into sebastianbergmann:10.5 Apr 14, 2024
31 checks passed
@staabm staabm deleted the regress5795 branch April 14, 2024 06:58
@staabm
Copy link
Contributor Author

staabm commented Apr 14, 2024

I should have said "No!" at the time, but did not :-(

Without trying we wouldn't know. So it was a small failed experiment.. just look forward :-)

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 this pull request may close these issues.

2 participants