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

Convert unhandled PHPT exceptions to skipped test result #3529

Merged
merged 2 commits into from Feb 14, 2019
Merged

Convert unhandled PHPT exceptions to skipped test result #3529

merged 2 commits into from Feb 14, 2019

Conversation

epdenouden
Copy link
Contributor

Fixes #3011 which is very much like #3490

Verification

You can see the exception handling at work when you manually run the new end-to-end test:

phpunit --testdox tests/_files/phpt-unsupported-section.phpt

[...]
PHPUnit\Runner\PhptTestCase
 → tests/_files/phpt-unsupported-section.phpt [0.00 ms]
   │
   │ PHPUnit does not support PHPT GET sections
   │ 
[...]

Changes

  • PHPT parsing exceptions now result in a properly skipped test instead of stopping PHPUnit
  • update existing PhptTestCase unit tests
  • add new end-to-end test with unsupported PHPT --SECTION--

Note

The improved exception handling is designed to prevent PHPUnit from crashing out during a run, which works in both the 7.x and 8.x major versions. Version 8 additionally has the improved Testdox and error output which provides much more detailed code locations.

@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #3529 into 7.5 will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                7.5    #3529      +/-   ##
============================================
+ Coverage     83.41%   83.44%   +0.02%     
- Complexity     3627     3628       +1     
============================================
  Files           143      143              
  Lines          9662     9667       +5     
============================================
+ Hits           8060     8067       +7     
+ Misses         1602     1600       -2
Impacted Files Coverage Δ Complexity Δ
src/Runner/PhptTestCase.php 81.46% <100%> (+1.28%) 84 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63f1138...2b7e387. Read the comment docs.

@sebastianbergmann sebastianbergmann merged commit 54847b2 into sebastianbergmann:7.5 Feb 14, 2019
@epdenouden epdenouden deleted the issue-3011-handle-phpt-parse-exceptions branch February 14, 2019 16:23
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

2 participants