Skip to content

Commit

Permalink
Added a few more tests for the T_FN backfill (ref #2863, #2860, #2859)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Feb 9, 2020
1 parent 2adcb64 commit 3a62dd4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/Core/Tokenizer/BackfillFnTokenTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ $fn = fn($a) => $a ? /* testTernaryThen */ fn() : string => 'a' : /* testTernary
/* testConstantDeclaration */
const FN = 'a';

/* testConstantDeclarationLower */
const fn = 'a';

class Foo {
/* testStaticMethodName */
public static function fn($param) {
Expand All @@ -101,9 +104,15 @@ $a = Foo::fn($param);
/* testNonArrowConstantAccess */
$a = MyClass::FN;

/* testNonArrowConstantAccessMixed */
$a = MyClass::Fn;

/* testNonArrowObjectMethodCall */
$a = $obj->fn($param);

/* testNonArrowObjectMethodCallUpper */
$a = $obj->FN($param);

/* testNonArrowNamespacedFunctionCall */
$a = MyNS\Sub\Fn($param);

Expand Down
13 changes: 12 additions & 1 deletion tests/Core/Tokenizer/BackfillFnTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,10 @@ public function dataNotAnArrowFunction()
'/* testConstantDeclaration */',
'FN',
],
[
'/* testConstantDeclarationLower */',
'fn',
],
['/* testStaticMethodName */'],
['/* testPropertyAssignment */'],
[
Expand All @@ -615,12 +619,19 @@ public function dataNotAnArrowFunction()
'/* testNonArrowConstantAccess */',
'FN',
],
[
'/* testNonArrowConstantAccessMixed */',
'Fn',
],
['/* testNonArrowObjectMethodCall */'],
[
'/* testNonArrowNamespacedFunctionCall */',
'Fn',
],
['/* testNonArrowNamespaceOperatorFunctionCall */'],

This comment has been minimized.

Copy link
@jrfnl

jrfnl Feb 9, 2020

Contributor

Uh..oh... this test case is no longer being tested ...

This comment has been minimized.

Copy link
@gsherwood

gsherwood Feb 9, 2020

Author Member

Thanks, on it now

[
'/* testNonArrowObjectMethodCallUpper */',
'FN',
],
['/* testLiveCoding */'],
];

Expand Down

0 comments on commit 3a62dd4

Please sign in to comment.