Skip to content

Commit ea810a2

Browse files
committed
Fixed tests for #2860
1 parent 5bb5f83 commit ea810a2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tests/Core/Tokenizer/BackfillFnTokenTest.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn(array $a) : array => $a;
7474
$fn = fn($a) => $a ? /* testTernaryThen */ fn() : string => 'a' : /* testTernaryElse */ fn() : string => 'b';
7575

7676
/* testConstantDeclaration */
77-
const FN = 'a';
77+
const fn = 'a';
7878

7979
class Foo {
8080
/* testStaticMethodName */
@@ -102,10 +102,10 @@ $a = Foo::fn($param);
102102
$a = Foo::fn($param)->another();
103103

104104
/* testNonArrowStaticConstant */
105-
$a = MyClass::FN;
105+
$a = MyClass::fn;
106106

107107
/* testNonArrowStaticConstantDeref */
108-
$a = MyClass::FN[$a];
108+
$a = MyClass::fn[$a];
109109

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

tests/Core/Tokenizer/BackfillFnTokenTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ public function testNotAnArrowFunction($testMarker)
573573
{
574574
$tokens = self::$phpcsFile->getTokens();
575575

576-
$token = $this->getTargetToken('/* testFunctionName */', [T_STRING, T_FN], 'fn');
576+
$token = $this->getTargetToken($testMarker, [T_STRING, T_FN], 'fn');
577577
$tokenArray = $tokens[$token];
578578

579579
$this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING');
@@ -598,11 +598,14 @@ public function testNotAnArrowFunction($testMarker)
598598
public function dataNotAnArrowFunction()
599599
{
600600
return [
601+
['/* testConstantDeclaration */'],
601602
['/* testFunctionName */'],
602603
['/* testStaticMethodName */'],
603604
['/* testAnonClassMethodName */'],
604605
['/* testNonArrowStaticMethodCall */'],
605606
['/* testNonArrowStaticMethodCallWithChaining */'],
607+
['/* testNonArrowStaticConstant */'],
608+
['/* testNonArrowStaticConstantDeref */'],
606609
['/* testNonArrowObjectMethodCall */'],
607610
['/* testNonArrowNamespacedFunctionCall */'],
608611
['/* testNonArrowNamespaceOperatorFunctionCall */'],

0 commit comments

Comments
 (0)