You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests/Tokenizer: test to ensure scope closer is set correctly for T_CASE
This commit copies a sniff test from InlineControlStructureUnitTest.php
to the `Tokenizer::recurseScopeMap()` tests for the case keyword. This
test was added in b498dbe before the Tokenizer tests were created. It
ensures that the scope for the `T_CASE` token is correctly set when
there is an if/elseif/else with and without braces inside it.
Note that this test currently does not fail even when the changes to the
tokenizer applied in b498dbe are reverted. I'm assuming that a
subsequent commit further improved the tokenizer and made the changes
from b498dbe redundant, but I was not able to find the specific commit
using `git bissect`. That being said, I was able to confirm that before
b498dbe, the scope closer for the `T_CASE` token was incorrectly set to
`T_RETURN` instead of `T_BREAK`.
The original sniff test was kept without any modification as testing
if/elseif/else with and without curly braces inside another control
structure is still valid.
0 commit comments