Skip to content

Commit 6c0b405

Browse files
committed
Tests/Tokenizer: reorganize default keyword tests order
Now that the `default` keyword tests use markers instead of offsets, the switch default tests that were added more recently can be placed together with the previous switch default tests.
1 parent 6535f72 commit 6c0b405

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.inc

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,31 @@ function switchWithDefaultInMatch() {
9595
};
9696
}
9797

98+
function switchAndDefaultSharingScopeCloser($i) {
99+
switch ($i):
100+
/* testSwitchAndDefaultSharingScopeCloser */
101+
default:
102+
echo 'one';
103+
/* testSwitchAndDefaultSharingScopeCloserScopeCloser */
104+
endswitch;
105+
}
106+
107+
function switchDefaultNestedIfWithAndWithoutBraces($i, $foo, $baz) {
108+
switch ($i) {
109+
/* testSwitchDefaultNestedIfWithAndWithoutBraces */
110+
default:
111+
if ($foo) {
112+
return true;
113+
} elseif ($baz)
114+
return true;
115+
else {
116+
echo 'else';
117+
}
118+
/* testSwitchDefaultNestedIfWithAndWithoutBracesScopeCloser */
119+
break;
120+
}
121+
}
122+
98123
function shortArrayWithConstantKey() {
99124
$arr = [
100125
/* testClassConstantAsShortArrayKey */
@@ -204,28 +229,3 @@ class Foo {
204229
/* testMethodDeclaration */
205230
public function default() {}
206231
}
207-
208-
function switchAndDefaultSharingScopeCloser($i) {
209-
switch ($i):
210-
/* testSwitchAndDefaultSharingScopeCloser */
211-
default:
212-
echo 'one';
213-
/* testSwitchAndDefaultSharingScopeCloserScopeCloser */
214-
endswitch;
215-
}
216-
217-
function switchDefaultNestedIfWithAndWithoutBraces($i, $foo, $baz) {
218-
switch ($i) {
219-
/* testSwitchDefaultNestedIfWithAndWithoutBraces */
220-
default:
221-
if ($foo) {
222-
return true;
223-
} elseif ($baz)
224-
return true;
225-
else {
226-
echo 'else';
227-
}
228-
/* testSwitchDefaultNestedIfWithAndWithoutBracesScopeCloser */
229-
break;
230-
}
231-
}

0 commit comments

Comments
 (0)