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

CodeCoverage: refactor to pure Singleton #5179

Merged

Conversation

Slamdunk
Copy link
Contributor

@Slamdunk Slamdunk commented Feb 7, 2023

Hi, this PR sets a clear line between the Singleton instance and its behaviour for:

  1. \PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry
  2. \PHPUnit\Runner\CodeCoverage

Allowing to have local instances that do not interfere with active PHPUnit run.

For PHPUnit the benefit is that these classes become now unit-testable, if needed.
For external project like ParaTest (I'm aware that I'm dealing with @internal classes) this means these classes can be used without mangling PHPUnit internal state.

@sebastianbergmann sebastianbergmann added type/refactoring A refactoring that should be applied to make the code easier to understand and maintain feature/test-runner CLI test runner labels Feb 7, 2023
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Merging #5179 (6eceb69) into 10.0 (b4d036a) will decrease coverage by 0.02%.
The diff coverage is 25.98%.

❗ Current head 6eceb69 differs from pull request most recent head 69b138a. Consider uploading reports for the commit 69b138a to get more accurate results

@@             Coverage Diff              @@
##               10.0    #5179      +/-   ##
============================================
- Coverage     81.28%   81.27%   -0.02%     
- Complexity     5841     5843       +2     
============================================
  Files           629      629              
  Lines         18511    18512       +1     
============================================
- Hits          15047    15045       -2     
- Misses         3464     3467       +3     
Impacted Files Coverage Δ
.../Command/Commands/WarmCodeCoverageCacheCommand.php 0.00% <0.00%> (ø)
src/Runner/CodeCoverage.php 11.51% <20.23%> (+1.89%) ⬆️
...extUI/Configuration/CodeCoverageFilterRegistry.php 21.21% <29.41%> (+10.86%) ⬆️
src/Runner/PhptTestCase.php 68.93% <44.44%> (ø)
src/Util/PHP/AbstractPhpProcess.php 79.33% <50.00%> (ø)
src/TextUI/Application.php 82.08% <60.00%> (ø)
src/Framework/TestRunner.php 86.99% <75.00%> (ø)
src/Event/Value/Test/TestCollection.php 40.00% <0.00%> (-20.00%) ⬇️
...stSuite/TestSuiteForTestMethodWithDataProvider.php 37.50% <0.00%> (-12.50%) ⬇️
src/Event/Value/TestSuite/TestSuite.php 96.22% <0.00%> (-3.78%) ⬇️
... and 5 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/refactoring A refactoring that should be applied to make the code easier to understand and maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants