Generic/LanguageConstructSpacing: improve sniff code coverage #176
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
This PR improves the code coverage for the Generic/LanguageConstructSpacing sniff.
There was just one block of code that was not covered by tests: /src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php#L131. It is an
else if
condition to handle language constructs that are followed by some content without a space or opening parenthesis first. This adds a few examples to make sure this part of the code is covered.This PR also restructures the test case files for this sniff and moves an intentional parse error test to its own file per #143.
Code coverage for the Generic/ArbitraryParenthesesSpacing sniff before this PR:
https://coveralls.io/builds/64633852/source?filename=src%2FStandards%2FGeneric%2FSniffs%2FWhiteSpace%2FLanguageConstructSpacingSniff.php
And after this PR:
https://coveralls.io/builds/64687021/source?filename=src%2FStandards%2FGeneric%2FSniffs%2FWhiteSpace%2FLanguageConstructSpacingSniff.php
Related issues/external references
Part of #146
Types of changes
PR checklist