@@ -29,47 +29,67 @@ public function getLexTests(): iterable
29
29
{
30
30
yield 'simple_component ' => [
31
31
'<twig:foo /> ' ,
32
- '{% component foo %}{% endcomponent %} ' ,
32
+ '{% component \' foo \' %}{% endcomponent %} ' ,
33
33
];
34
34
35
35
yield 'component_with_attributes ' => [
36
36
'<twig:foo bar="baz" with_quotes="It \'s with quotes" /> ' ,
37
- "{% component foo with { bar: 'baz', with_quotes: 'It\'s with quotes' } %}{% endcomponent %} " ,
37
+ "{% component ' foo' with { bar: 'baz', with_quotes: 'It\'s with quotes' } %}{% endcomponent %} " ,
38
38
];
39
39
40
40
yield 'component_with_dynamic_attributes ' => [
41
41
'<twig:foo dynamic="{{ dynamicVar }}" :otherDynamic="anotherVar" /> ' ,
42
- '{% component foo with { dynamic: dynamicVar, otherDynamic: anotherVar } %}{% endcomponent %} ' ,
42
+ '{% component \' foo \' with { dynamic: dynamicVar, otherDynamic: anotherVar } %}{% endcomponent %} ' ,
43
43
];
44
44
45
45
yield 'component_with_closing_tag ' => [
46
46
'<twig:foo></twig:foo> ' ,
47
- '{% component foo %}{% endcomponent %} ' ,
47
+ '{% component \' foo \' %}{% endcomponent %} ' ,
48
48
];
49
49
50
50
yield 'component_with_block ' => [
51
51
'<twig:foo><twig:block name="foo_block">Foo</twig:block></twig:foo> ' ,
52
- '{% component foo %}{% block foo_block %}Foo{% endblock %}{% endcomponent %} ' ,
52
+ '{% component \' foo \' %}{% block foo_block %}Foo{% endblock %}{% endcomponent %} ' ,
53
53
];
54
54
55
55
yield 'component_with_embedded_component_inside_block ' => [
56
56
'<twig:foo><twig:block name="foo_block"><twig:bar /></twig:block></twig:foo> ' ,
57
- '{% component foo %}{% block foo_block %}{% component bar %}{% endcomponent %}{% endblock %}{% endcomponent %} ' ,
57
+ '{% component \' foo \' %}{% block foo_block %}{% component \' bar \' %}{% endcomponent %}{% endblock %}{% endcomponent %} ' ,
58
58
];
59
59
60
60
yield 'attribute_with_no_value ' => [
61
61
'<twig:foo bar /> ' ,
62
- '{% component foo with { bar: true } %}{% endcomponent %} ' ,
62
+ '{% component \' foo \' with { bar: true } %}{% endcomponent %} ' ,
63
63
];
64
64
65
65
yield 'component_with_default_block_content ' => [
66
66
'<twig:foo>Foo</twig:foo> ' ,
67
- '{% component foo %}{% block content %}Foo{% endblock %}{% endcomponent %} ' ,
67
+ '{% component \' foo \' %}{% block content %}Foo{% endblock %}{% endcomponent %} ' ,
68
68
];
69
69
70
70
yield 'component_with_default_block_that_holds_a_component_and_multi_blocks ' => [
71
71
'<twig:foo>Foo <twig:bar /><twig:block name="other_block">Other block</twig:block></twig:foo> ' ,
72
- '{% component foo %}{% block content %}Foo {% component bar %}{% endcomponent %}{% endblock %}{% block other_block %}Other block{% endblock %}{% endcomponent %} ' ,
72
+ '{% component \'foo \' %}{% block content %}Foo {% component \'bar \' %}{% endcomponent %}{% endblock %}{% block other_block %}Other block{% endblock %}{% endcomponent %} ' ,
73
+ ];
74
+ yield 'component_with_character_:_on_his_name ' => [
75
+ '<twig:foo:bar></twig:foo:bar> ' ,
76
+ '{% component \'foo:bar \' %}{% endcomponent %} ' ,
77
+ ];
78
+ yield 'component_with_character_@_on_his_name ' => [
79
+ '<twig:@foo></twig:@foo> ' ,
80
+ '{% component \'@foo \' %}{% endcomponent %} ' ,
81
+ ];
82
+ yield 'component_with_character_-_on_his_name ' => [
83
+ '<twig:foo-bar></twig:foo-bar> ' ,
84
+ '{% component \'foo-bar \' %}{% endcomponent %} ' ,
85
+ ];
86
+ yield 'component_with_character_/_on_his_name ' => [
87
+ '<twig:foo/bar></twig:foo/bar> ' ,
88
+ '{% component \'foo/bar \' %}{% endcomponent %} ' ,
89
+ ];
90
+ yield 'component_with_character_._on_his_name ' => [
91
+ '<twig:foo.bar></twig:foo.bar> ' ,
92
+ '{% component \'foo.bar \' %}{% endcomponent %} ' ,
73
93
];
74
94
}
75
95
}
0 commit comments