Skip to content

Commit 3a62dd4

Browse files
committed
Added a few more tests for the T_FN backfill (ref #2863, #2860, #2859)
1 parent 2adcb64 commit 3a62dd4

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

tests/Core/Tokenizer/BackfillFnTokenTest.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ $fn = fn($a) => $a ? /* testTernaryThen */ fn() : string => 'a' : /* testTernary
7676
/* testConstantDeclaration */
7777
const FN = 'a';
7878

79+
/* testConstantDeclarationLower */
80+
const fn = 'a';
81+
7982
class Foo {
8083
/* testStaticMethodName */
8184
public static function fn($param) {
@@ -101,9 +104,15 @@ $a = Foo::fn($param);
101104
/* testNonArrowConstantAccess */
102105
$a = MyClass::FN;
103106

107+
/* testNonArrowConstantAccessMixed */
108+
$a = MyClass::Fn;
109+
104110
/* testNonArrowObjectMethodCall */
105111
$a = $obj->fn($param);
106112

113+
/* testNonArrowObjectMethodCallUpper */
114+
$a = $obj->FN($param);
115+
107116
/* testNonArrowNamespacedFunctionCall */
108117
$a = MyNS\Sub\Fn($param);
109118

tests/Core/Tokenizer/BackfillFnTokenTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,10 @@ public function dataNotAnArrowFunction()
604604
'/* testConstantDeclaration */',
605605
'FN',
606606
],
607+
[
608+
'/* testConstantDeclarationLower */',
609+
'fn',
610+
],
607611
['/* testStaticMethodName */'],
608612
['/* testPropertyAssignment */'],
609613
[
@@ -615,12 +619,19 @@ public function dataNotAnArrowFunction()
615619
'/* testNonArrowConstantAccess */',
616620
'FN',
617621
],
622+
[
623+
'/* testNonArrowConstantAccessMixed */',
624+
'Fn',
625+
],
618626
['/* testNonArrowObjectMethodCall */'],
619627
[
620628
'/* testNonArrowNamespacedFunctionCall */',
621629
'Fn',
622630
],
623-
['/* testNonArrowNamespaceOperatorFunctionCall */'],
631+
[
632+
'/* testNonArrowObjectMethodCallUpper */',
633+
'FN',
634+
],
624635
['/* testLiveCoding */'],
625636
];
626637

0 commit comments

Comments
 (0)