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

Restore support for PSR-0-style test-classes (#5020) #5021

Merged
merged 4 commits into from Aug 11, 2022

Conversation

totten
Copy link
Contributor

@totten totten commented Jul 20, 2022

As per #5020, this PR fixes loading of test-classes which have underscore-based namespacing (e.g. loading CRM_Utils_StringTest in file tests/phpunit/CRM/Utils/StringTest.php from example repo https://github.com/totten/phpunit-underscore-namespace). The PR also adds an end-to-end regression test.

Note: The patch for main is very slightly different (and slightly shorter). I've only opened the PR for 9.x (since that's the older version with the bug), but you can see main patches at https://github.com/totten/phpunit/commits/main-psr0

@codecov
Copy link

codecov bot commented Jul 23, 2022

Codecov Report

Merging #5021 (7b49c19) into 9.5 (542bc07) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##                9.5    #5021   +/-   ##
=========================================
  Coverage     83.96%   83.97%           
- Complexity     4611     4614    +3     
=========================================
  Files           272      272           
  Lines         11464    11468    +4     
=========================================
+ Hits           9626     9630    +4     
  Misses         1838     1838           
Impacted Files Coverage Δ
src/Framework/TestSuite.php 82.99% <100.00%> (+0.05%) ⬆️
src/Runner/StandardTestSuiteLoader.php 87.87% <100.00%> (+1.21%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@sebastianbergmann
Copy link
Owner

@realFlowControl Do you have feedback on this? Thanks!

Copy link
Sponsor Contributor

@realFlowControl realFlowControl left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I don't know if we actually need my suggested comment, but I would at least help the future @realFlowControl 😉

src/Runner/StandardTestSuiteLoader.php Show resolved Hide resolved
@totten
Copy link
Contributor Author

totten commented Aug 2, 2022

@sebastianbergmann - Comments were updated following @realFlowControl's suggestion. (If it helps, I also added comments on the main-psr0 variant of this branch.)

It should be OK to re-run the test?

@sebastianbergmann sebastianbergmann merged commit 2bdc999 into sebastianbergmann:9.5 Aug 11, 2022
@sebastianbergmann
Copy link
Owner

Thank you! I have merged this into the 9.5 branch.

However, the patch cannot simply be merged into main for PHPUnit 10. I will accept a pull request for main that restores support for PEAR-style test-classes, but I will not work on this myself.

@totten
Copy link
Contributor Author

totten commented Aug 12, 2022

Thank you @sebastianbergmann! I've submitted the port as #5030.

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.

None yet

3 participants