Skip to content

Tests/Tokenizer: fix bug in the default keyword tests #850

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

Merged
merged 2 commits into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -112,7 +112,8 @@ public static function dataMatchDefault()
* @param string $testMarker The comment prefacing the target token.
* @param int $openerOffset The expected offset of the scope opener in relation to the testMarker.
* @param int $closerOffset The expected offset of the scope closer in relation to the testMarker.
* @param int|null $conditionStop The expected offset at which tokens stop having T_DEFAULT as a scope condition.
* @param int|null $conditionStop The expected offset in relation to the testMarker, at which tokens stop
* having T_DEFAULT as a scope condition.
* @param string $testContent The token content to look for.
*
* @dataProvider dataSwitchDefault
@@ -158,7 +159,7 @@ public function testSwitchDefault($testMarker, $openerOffset, $closerOffset, $co
if (($opener + 1) !== $closer) {
$end = $closer;
if (isset($conditionStop) === true) {
$end = $conditionStop;
$end = ($token + $conditionStop);
}

for ($i = ($opener + 1); $i < $end; $i++) {