diff --git a/tests/Core/Tokenizer/BackfillFnTokenTest.inc b/tests/Core/Tokenizer/BackfillFnTokenTest.inc index 1401b64629..7412d55c5a 100644 --- a/tests/Core/Tokenizer/BackfillFnTokenTest.inc +++ b/tests/Core/Tokenizer/BackfillFnTokenTest.inc @@ -74,7 +74,7 @@ fn(array $a) : array => $a; $fn = fn($a) => $a ? /* testTernaryThen */ fn() : string => 'a' : /* testTernaryElse */ fn() : string => 'b'; /* testConstantDeclaration */ -const FN = 'a'; +const fn = 'a'; class Foo { /* testStaticMethodName */ @@ -102,10 +102,10 @@ $a = Foo::fn($param); $a = Foo::fn($param)->another(); /* testNonArrowStaticConstant */ -$a = MyClass::FN; +$a = MyClass::fn; /* testNonArrowStaticConstantDeref */ -$a = MyClass::FN[$a]; +$a = MyClass::fn[$a]; /* testNonArrowObjectMethodCall */ $a = $obj->fn($param); diff --git a/tests/Core/Tokenizer/BackfillFnTokenTest.php b/tests/Core/Tokenizer/BackfillFnTokenTest.php index 09f9cef308..0f6f190e4c 100644 --- a/tests/Core/Tokenizer/BackfillFnTokenTest.php +++ b/tests/Core/Tokenizer/BackfillFnTokenTest.php @@ -573,7 +573,7 @@ public function testNotAnArrowFunction($testMarker) { $tokens = self::$phpcsFile->getTokens(); - $token = $this->getTargetToken('/* testFunctionName */', [T_STRING, T_FN], 'fn'); + $token = $this->getTargetToken($testMarker, [T_STRING, T_FN], 'fn'); $tokenArray = $tokens[$token]; $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING'); @@ -598,11 +598,14 @@ public function testNotAnArrowFunction($testMarker) public function dataNotAnArrowFunction() { return [ + ['/* testConstantDeclaration */'], ['/* testFunctionName */'], ['/* testStaticMethodName */'], ['/* testAnonClassMethodName */'], ['/* testNonArrowStaticMethodCall */'], ['/* testNonArrowStaticMethodCallWithChaining */'], + ['/* testNonArrowStaticConstant */'], + ['/* testNonArrowStaticConstantDeref */'], ['/* testNonArrowObjectMethodCall */'], ['/* testNonArrowNamespacedFunctionCall */'], ['/* testNonArrowNamespaceOperatorFunctionCall */'],