diff --git a/tests/Core/Tokenizer/AttributesTest.inc b/tests/Core/Tokenizer/AttributesTest.inc index f0c117c658..213ff5c1ae 100644 --- a/tests/Core/Tokenizer/AttributesTest.inc +++ b/tests/Core/Tokenizer/AttributesTest.inc @@ -22,6 +22,10 @@ function attribute_on_function_test() {} #[AttributeWithParams('foo', bar: ['bar' => 'foobar'])] function attribute_with_params_on_function_test() {} +/* testAttributeWithShortClosureParameter */ +#[AttributeWithParams(static fn ($value) => ! $value)] +function attribute_with_short_closure_param_test() {} + /* testTwoAttributeOnTheSameLine */ #[CustomAttribute] #[AttributeWithParams('foo')] function two_attribute_on_same_line_test() {} diff --git a/tests/Core/Tokenizer/AttributesTest.php b/tests/Core/Tokenizer/AttributesTest.php index 49a39b03d9..48260b1d09 100644 --- a/tests/Core/Tokenizer/AttributesTest.php +++ b/tests/Core/Tokenizer/AttributesTest.php @@ -128,6 +128,28 @@ public function dataAttribute() T_CLOSE_PARENTHESIS, ], ], + [ + '/* testAttributeWithShortClosureParameter */', + 17, + [ + T_STRING, + T_OPEN_PARENTHESIS, + T_STATIC, + T_WHITESPACE, + T_FN, + T_WHITESPACE, + T_OPEN_PARENTHESIS, + T_VARIABLE, + T_CLOSE_PARENTHESIS, + T_WHITESPACE, + T_FN_ARROW, + T_WHITESPACE, + T_BOOLEAN_NOT, + T_WHITESPACE, + T_VARIABLE, + T_CLOSE_PARENTHESIS, + ], + ], [ '/* testAttributeGrouping */', 26,