22
33namespace Performing \TwigComponents \Tests ;
44
5+ use PHPUnit \Framework \Attributes \Test ;
6+
57trait ComponentsTestTrait
68{
7- /** @test */
9+ #[Test]
810 public function render_simple_component ()
911 {
1012 $ html = $ this ->twig ->render ('test_simple_component.twig ' );
@@ -14,7 +16,7 @@ public function render_simple_component()
1416 HTML , $ html );
1517 }
1618
17- /** @test */
19+ #[Test]
1820 public function render_simple_component_with_dash ()
1921 {
2022 $ html = $ this ->twig ->render ('test_simple_component_with_dash.twig ' );
@@ -24,7 +26,7 @@ public function render_simple_component_with_dash()
2426 HTML , $ html );
2527 }
2628
27- /** @test */
29+ #[Test]
2830 public function render_simple_component_in_folder ()
2931 {
3032 $ html = $ this ->twig ->render ('test_simple_component_in_folder.twig ' );
@@ -34,7 +36,7 @@ public function render_simple_component_in_folder()
3436 HTML , $ html );
3537 }
3638
37- /** @test */
39+ #[Test]
3840 public function render_component_with_slots ()
3941 {
4042 $ html = $ this ->twig ->render ('test_with_slots.twig ' );
@@ -44,7 +46,7 @@ public function render_component_with_slots()
4446 HTML , $ html );
4547 }
4648
47- /** @test */
49+ #[Test]
4850 public function render_xtags_with_slots ()
4951 {
5052 $ html = $ this ->twig ->render ('test_xtags_with_slots.twig ' );
@@ -54,7 +56,7 @@ public function render_xtags_with_slots()
5456 HTML , $ html );
5557 }
5658
57- /** @test */
59+ #[Test]
5860 public function render_nested_xtags_with_slots ()
5961 {
6062 $ html = $ this ->twig ->render ('test_nested_xtags_with_slots.twig ' );
@@ -64,7 +66,7 @@ public function render_nested_xtags_with_slots()
6466 HTML , $ html );
6567 }
6668
67- /** @test */
69+ #[Test]
6870 public function render_deeply_nested_xtags_with_slots ()
6971 {
7072 $ html = $ this ->twig ->render ('test_deeply_nested_xtags_with_slots.twig ' );
@@ -75,7 +77,7 @@ public function render_deeply_nested_xtags_with_slots()
7577 HTML , $ html );
7678 }
7779
78- /** @test */
80+ #[Test]
7981 public function render_component_with_xtags ()
8082 {
8183 $ html = $ this ->twig ->render ('test_xtags_component.twig ' );
@@ -87,7 +89,7 @@ public function render_component_with_xtags()
8789 HTML , $ html );
8890 }
8991
90- /** @test */
92+ #[Test]
9193 public function render_component_with_attributes ()
9294 {
9395 $ html = $ this ->twig ->render ('test_with_attributes.twig ' );
@@ -101,7 +103,7 @@ public function render_component_with_attributes()
101103 HTML , $ html );
102104 }
103105
104- /** @test */
106+ #[Test]
105107 public function render_namespaced_component ()
106108 {
107109 $ html = $ this ->twig ->render ('test_namespaced_component.twig ' );
@@ -111,7 +113,7 @@ public function render_namespaced_component()
111113 HTML , $ html );
112114 }
113115
114- /** @test */
116+ #[Test]
115117 public function render_namespaced_xtags_component ()
116118 {
117119 $ html = $ this ->twig ->render ('test_namespaced_xtags_component.twig ' );
@@ -123,7 +125,7 @@ public function render_namespaced_xtags_component()
123125 HTML , $ html );
124126 }
125127
126- /** @test */
128+ #[Test]
127129 public function test_class_merge_works_with_components_in_components ()
128130 {
129131 $ template = $ this ->twig ->createTemplate (<<<HTML
@@ -134,7 +136,7 @@ public function test_class_merge_works_with_components_in_components()
134136 $ this ->assertEquals ('<button class="mb-5 bg-red-500 text-white">Click me</button> ' , $ html );
135137 }
136138
137- /** @test */
139+ #[Test]
138140 public function test_attributes_dont_conflict_with_components_in_components ()
139141 {
140142 $ template = $ this ->twig ->createTemplate (<<<HTML
@@ -145,7 +147,7 @@ public function test_attributes_dont_conflict_with_components_in_components()
145147 $ this ->assertEquals ('<div class="mb-5 bg-red-500"><button class="text-white">Click me</button></div> ' , $ html );
146148 }
147149
148- /** @test */
150+ #[Test]
149151 public function render_simple_dynamic_component ()
150152 {
151153 $ html = $ this ->twig ->render ('test_simple_dynamic_component.twig ' );
@@ -156,7 +158,7 @@ public function render_simple_dynamic_component()
156158 HTML , $ html );
157159 }
158160
159- /** @test */
161+ #[Test]
160162 public function render_dynamic_component_with_xtags ()
161163 {
162164 $ html = $ this ->twig ->render ('test_xtags_dynamic_component.twig ' );
@@ -168,7 +170,7 @@ public function render_dynamic_component_with_xtags()
168170 HTML , $ html );
169171 }
170172
171- /** @test */
173+ #[Test]
172174 public function render_namespaced_dynamic_component ()
173175 {
174176 $ html = $ this ->twig ->render ('test_namespaced_dynamic_component.twig ' );
@@ -178,7 +180,7 @@ public function render_namespaced_dynamic_component()
178180 HTML , $ html );
179181 }
180182
181- /** @test */
183+ #[Test]
182184 public function render_namespaced_xtags_dynamic_component ()
183185 {
184186 $ html = $ this ->twig ->render ('test_namespaced_xtags_dynamic_component.twig ' );
0 commit comments