44
55use Matthias \SymfonyDependencyInjectionTest \PhpUnit \AbstractExtensionTestCase ;
66use Matthias \SymfonyDependencyInjectionTest \Tests \Fixtures \MatthiasDependencyInjectionTestExtension ;
7+ use PHPUnit \Framework \Attributes \Test ;
78use PHPUnit \Framework \ExpectationFailedException ;
89
910class AbstractExtensionTestCaseTest extends AbstractExtensionTestCase
@@ -15,9 +16,7 @@ protected function getContainerExtensions(): array
1516 ];
1617 }
1718
18- /**
19- * @test
20- */
19+ #[Test]
2120 public function if_load_is_successful_it_does_not_fail (): void
2221 {
2322 $ this ->load ();
@@ -61,9 +60,7 @@ public function if_load_is_successful_it_does_not_fail(): void
6160 $ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('manual_service_id ' , 1 );
6261 }
6362
64- /**
65- * @test
66- */
63+ #[Test]
6764 public function if_service_is_undefined_it_fails (): void
6865 {
6966 $ this ->load ();
@@ -73,9 +70,7 @@ public function if_service_is_undefined_it_fails(): void
7370 $ this ->assertContainerBuilderHasService ('undefined ' , 'AnyClass ' );
7471 }
7572
76- /**
77- * @test
78- */
73+ #[Test]
7974 public function if_synthetic_service_is_undefined_it_fails (): void
8075 {
8176 $ this ->load ();
@@ -86,9 +81,7 @@ public function if_synthetic_service_is_undefined_it_fails(): void
8681 $ this ->assertContainerBuilderHasSyntheticService ('undefined ' );
8782 }
8883
89- /**
90- * @test
91- */
84+ #[Test]
9285 public function if_service_is_defined_but_not_synthetic_it_fails (): void
9386 {
9487 $ this ->load ();
@@ -99,9 +92,7 @@ public function if_service_is_defined_but_not_synthetic_it_fails(): void
9992 $ this ->assertContainerBuilderHasSyntheticService ('loaded_service_id ' );
10093 }
10194
102- /**
103- * @test
104- */
95+ #[Test]
10596 public function if_service_is_defined_but_has_another_class_it_fails (): void
10697 {
10798 $ this ->load ();
@@ -112,9 +103,7 @@ public function if_service_is_defined_but_has_another_class_it_fails(): void
112103 $ this ->assertContainerBuilderHasService ('manual_service_id ' , 'SomeOtherClass ' );
113104 }
114105
115- /**
116- * @test
117- */
106+ #[Test]
118107 public function if_alias_is_not_defined_it_fails (): void
119108 {
120109 $ this ->load ();
@@ -124,9 +113,7 @@ public function if_alias_is_not_defined_it_fails(): void
124113 $ this ->assertContainerBuilderHasAlias ('undefined ' , 'any_service_id ' );
125114 }
126115
127- /**
128- * @test
129- */
116+ #[Test]
130117 public function if_alias_exists_but_for_wrong_service_it_fails (): void
131118 {
132119 $ this ->load ();
@@ -137,9 +124,7 @@ public function if_alias_exists_but_for_wrong_service_it_fails(): void
137124 $ this ->assertContainerBuilderHasAlias ('manual_alias ' , 'wrong ' );
138125 }
139126
140- /**
141- * @test
142- */
127+ #[Test]
143128 public function if_parameter_does_not_exist_it_fails (): void
144129 {
145130 $ this ->load ();
@@ -150,9 +135,7 @@ public function if_parameter_does_not_exist_it_fails(): void
150135 $ this ->assertContainerBuilderHasParameter ('undefined ' , 'any value ' );
151136 }
152137
153- /**
154- * @test
155- */
138+ #[Test]
156139 public function if_parameter_exists_but_has_wrong_value_it_fails (): void
157140 {
158141 $ this ->load ();
@@ -163,9 +146,7 @@ public function if_parameter_exists_but_has_wrong_value_it_fails(): void
163146 $ this ->assertContainerBuilderHasParameter ('manual_parameter ' , 'wrong ' );
164147 }
165148
166- /**
167- * @test
168- */
149+ #[Test]
169150 public function if_parameter_exists_and_has_good_value_but_has_wrong_type_it_fails (): void
170151 {
171152 $ this ->load ();
@@ -176,9 +157,7 @@ public function if_parameter_exists_and_has_good_value_but_has_wrong_type_it_fai
176157 $ this ->assertContainerBuilderHasExactParameter ('manual_number_parameter ' , '123123 ' );
177158 }
178159
179- /**
180- * @test
181- */
160+ #[Test]
182161 public function if_parameter_exists_but_has_wrong_order_it_fails (): void
183162 {
184163 $ this ->load ();
@@ -189,9 +168,7 @@ public function if_parameter_exists_but_has_wrong_order_it_fails(): void
189168 $ this ->assertContainerBuilderHasExactParameter ('manual_array_parameter ' , ['key2 ' => 'value2 ' , 'key1 ' => 'value1 ' ]);
190169 }
191170
192- /**
193- * @test
194- */
171+ #[Test]
195172 public function if_definition_does_not_have_argument_it_fails (): void
196173 {
197174 $ this ->load ();
@@ -202,9 +179,7 @@ public function if_definition_does_not_have_argument_it_fails(): void
202179 $ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('manual_service_id ' , 10 , 'any value ' );
203180 }
204181
205- /**
206- * @test
207- */
182+ #[Test]
208183 public function if_definition_has_argument_but_with_wrong_value_it_fails (): void
209184 {
210185 $ this ->load ();
@@ -214,9 +189,7 @@ public function if_definition_has_argument_but_with_wrong_value_it_fails(): void
214189 $ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('manual_service_id ' , 1 , 'wrong value ' );
215190 }
216191
217- /**
218- * @test
219- */
192+ #[Test]
220193 public function if_definition_has_argument_but_with_wrong_value_it_fails1 (): void
221194 {
222195 $ this ->load ();
@@ -227,9 +200,7 @@ public function if_definition_has_argument_but_with_wrong_value_it_fails1(): voi
227200 $ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('manual_with_reference ' , 0 , 'manual_service_id ' );
228201 }
229202
230- /**
231- * @test
232- */
203+ #[Test]
233204 public function if_definition_is_decorated_and_argument_has_wrong_value_it_fails (): void
234205 {
235206 $ this ->load ();
@@ -240,9 +211,7 @@ public function if_definition_is_decorated_and_argument_has_wrong_value_it_fails
240211 $ this ->assertContainerBuilderHasServiceDefinitionWithArgument ('child_service_id ' , 1 , 'wrong value ' );
241212 }
242213
243- /**
244- * @test
245- */
214+ #[Test]
246215 public function if_definition_is_decorated_but_by_the_wrong_parent_it_fails (): void
247216 {
248217 $ this ->load ();
@@ -253,9 +222,7 @@ public function if_definition_is_decorated_but_by_the_wrong_parent_it_fails(): v
253222 $ this ->assertContainerBuilderHasServiceDefinitionWithParent ('child_service_id ' , 'wrong_parent_service_id ' );
254223 }
255224
256- /**
257- * @test
258- */
225+ #[Test]
259226 public function if_definition_should_be_decorated_when_it_is_not_it_fails (): void
260227 {
261228 $ this ->load ();
@@ -266,9 +233,7 @@ public function if_definition_should_be_decorated_when_it_is_not_it_fails(): voi
266233 $ this ->assertContainerBuilderHasServiceDefinitionWithParent ('parent_service_id ' , 'any_other_service_id ' );
267234 }
268235
269- /**
270- * @test
271- */
236+ #[Test]
272237 public function if_definition_should_have_a_method_call_and_it_has_not_it_fails (): void
273238 {
274239 $ this ->load ();
@@ -283,9 +248,7 @@ public function if_definition_should_have_a_method_call_and_it_has_not_it_fails(
283248 );
284249 }
285250
286- /**
287- * @test
288- */
251+ #[Test]
289252 public function if_definition_should_have_a_certain_arguments_for_a_method_call_and_it_has_not_it_fails (): void
290253 {
291254 $ this ->load ();
@@ -300,9 +263,7 @@ public function if_definition_should_have_a_certain_arguments_for_a_method_call_
300263 );
301264 }
302265
303- /**
304- * @test
305- */
266+ #[Test]
306267 public function if_service_is_defined_it_fails (): void
307268 {
308269 $ this ->load ();
@@ -312,19 +273,15 @@ public function if_service_is_defined_it_fails(): void
312273 $ this ->assertContainerBuilderNotHasService ('loaded_service_id ' );
313274 }
314275
315- /**
316- * @test
317- */
276+ #[Test]
318277 public function if_service_is_not_defined_it_does_not_fail (): void
319278 {
320279 $ this ->load ();
321280
322281 $ this ->assertContainerBuilderNotHasService ('undefined ' );
323282 }
324283
325- /**
326- * @test
327- */
284+ #[Test]
328285 public function if_service_is_not_defined_in_service_decoration_it_fails (): void
329286 {
330287 $ this ->load ();
@@ -335,9 +292,7 @@ public function if_service_is_not_defined_in_service_decoration_it_fails(): void
335292 $ this ->assertContainerBuilderServiceDecoration ('undefined ' , 'undefined ' );
336293 }
337294
338- /**
339- * @test
340- */
295+ #[Test]
341296 public function if_service_decoration_is_not_defined_in_service_decoration_it_fails (): void
342297 {
343298 $ this ->load ();
0 commit comments