Generators/Markdown: reset error_reporting to original value #688
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As things were, the
Markdown
class changes the PHP error level (to prevent potentially getting a warning about the timezone not being set), but doesn't reset the error level back to the original error level once the "risky" code has been executed.Fixed now.
This was previously already fixed for the
HTML
class in PR squizlabs/PHP_CodeSniffer#488Includes adding a test to safeguard this for both classes. These tests need to be run in isolation so as not to get interference from the fact that the code is run in a test environment. I.e. without the
@runInSeparateProcess
, the test wouldn't fail when it should.Suggested changelog entry
error_reporting
in an incorrect state.Related issues/external references
This PR is part of a series of PRs which will add a complete set of tests for the Generator feature.
Also see: #671.
Types of changes