Skip to content

Commit 2f92a4d

Browse files
committed
add test for fqcn attribute tokenization
1 parent 128a997 commit 2f92a4d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/Core/Tokenizer/AttributesTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ function single_attribute_on_parameter_test(#[ParamAttribute] int $param) {}
6060
/* testMultipleAttributesOnParameter */
6161
function multiple_attributes_on_parameter_test(#[ParamAttribute, AttributeWithParams(/* another comment */ 'foo')] int $param) {}
6262

63+
/* testFqcnAttribute */
64+
#[Boo\QualifiedName, \Foo\FullyQualifiedName('foo')]
65+
function fqcn_attrebute_test() {}
66+
6367
/* testMultilineAttributesOnParameter */
6468
function multiline_attributes_on_parameter_test(#[
6569
AttributeWithParams(

tests/Core/Tokenizer/AttributesTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace PHP_CodeSniffer\Tests\Core\Tokenizer;
1111

1212
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
13+
use PHP_CodeSniffer\Util\Tokens;
1314

1415
class AttributesTest extends AbstractMethodUnitTest
1516
{
@@ -217,6 +218,24 @@ public function dataAttribute()
217218
T_WHITESPACE,
218219
],
219220
],
221+
[
222+
'/* testFqcnAttribute */',
223+
13,
224+
[
225+
T_STRING,
226+
T_NS_SEPARATOR,
227+
T_STRING,
228+
T_COMMA,
229+
T_WHITESPACE,
230+
T_NS_SEPARATOR,
231+
T_STRING,
232+
T_NS_SEPARATOR,
233+
T_STRING,
234+
T_OPEN_PARENTHESIS,
235+
T_CONSTANT_ENCAPSED_STRING,
236+
T_CLOSE_PARENTHESIS,
237+
],
238+
],
220239
];
221240

222241
}//end dataAttribute()

0 commit comments

Comments
 (0)