@@ -32,6 +32,7 @@ public function setUp(): void
3232 /**
3333 * @test
3434 */
35+ #[\PHPUnit \Framework \Attributes \Test]
3536 public function should_invoke_closure ()
3637 {
3738 $ callable = new CallableSpy ;
@@ -44,6 +45,7 @@ public function should_invoke_closure()
4445 /**
4546 * @test
4647 */
48+ #[\PHPUnit \Framework \Attributes \Test]
4749 public function should_invoke_method ()
4850 {
4951 $ fixture = new InvokerTestFixture ;
@@ -56,6 +58,7 @@ public function should_invoke_method()
5658 /**
5759 * @test
5860 */
61+ #[\PHPUnit \Framework \Attributes \Test]
5962 public function cannot_invoke_unknown_method ()
6063 {
6164 $ this ->expectExceptionMessage ('Invoker\Test\InvokerTestFixture::bar() is not a callable. ' );
@@ -66,6 +69,7 @@ public function cannot_invoke_unknown_method()
6669 /**
6770 * @test
6871 */
72+ #[\PHPUnit \Framework \Attributes \Test]
6973 public function cannot_invoke_magic_method ()
7074 {
7175 $ this ->expectExceptionMessage ('Invoker\Test\InvokerTestMagicMethodFixture::foo() is not a callable. A __call() or __callStatic() method exists but magic methods are not supported. ' );
@@ -76,6 +80,7 @@ public function cannot_invoke_magic_method()
7680 /**
7781 * @test
7882 */
83+ #[\PHPUnit \Framework \Attributes \Test]
7984 public function cannot_invoke_static_magic_method ()
8085 {
8186 $ this ->expectExceptionMessage ('Invoker\Test\InvokerTestStaticMagicMethodFixture::foo() is not a callable. A __call() or __callStatic() method exists but magic methods are not supported. ' );
@@ -86,6 +91,7 @@ public function cannot_invoke_static_magic_method()
8691 /**
8792 * @test
8893 */
94+ #[\PHPUnit \Framework \Attributes \Test]
8995 public function should_invoke_static_method ()
9096 {
9197 $ result = $ this ->invoker ->call ([InvokerTestStaticFixture::class, 'foo ' ]);
@@ -96,6 +102,7 @@ public function should_invoke_static_method()
96102 /**
97103 * @test
98104 */
105+ #[\PHPUnit \Framework \Attributes \Test]
99106 public function should_invoke_static_method_with_scope_resolution_syntax ()
100107 {
101108 $ result = $ this ->invoker ->call ('Invoker\Test\InvokerTestStaticFixture::foo ' );
@@ -106,6 +113,7 @@ public function should_invoke_static_method_with_scope_resolution_syntax()
106113 /**
107114 * @test
108115 */
116+ #[\PHPUnit \Framework \Attributes \Test]
109117 public function should_return_the_callable_return_value ()
110118 {
111119 $ result = $ this ->invoker ->call (function () {
@@ -118,6 +126,7 @@ public function should_return_the_callable_return_value()
118126 /**
119127 * @test
120128 */
129+ #[\PHPUnit \Framework \Attributes \Test]
121130 public function should_throw_if_no_value_for_parameter ()
122131 {
123132 $ this ->expectExceptionMessage ('Unable to invoke the callable because no value was given for parameter 2 ($bar) ' );
@@ -132,6 +141,7 @@ public function should_throw_if_no_value_for_parameter()
132141 /**
133142 * @test
134143 */
144+ #[\PHPUnit \Framework \Attributes \Test]
135145 public function should_throw_if_no_value_for_parameter_even_with_trailing_optional_parameters ()
136146 {
137147 $ this ->expectExceptionMessage ('Unable to invoke the callable because no value was given for parameter 2 ($bar) ' );
@@ -146,6 +156,7 @@ public function should_throw_if_no_value_for_parameter_even_with_trailing_option
146156 /**
147157 * @test
148158 */
159+ #[\PHPUnit \Framework \Attributes \Test]
149160 public function should_invoke_callable_with_parameters_indexed_by_position ()
150161 {
151162 $ callable = new CallableSpy ;
@@ -158,6 +169,7 @@ public function should_invoke_callable_with_parameters_indexed_by_position()
158169 /**
159170 * @test
160171 */
172+ #[\PHPUnit \Framework \Attributes \Test]
161173 public function should_invoke_callable_with_parameters_indexed_by_name ()
162174 {
163175 $ parameters = [
@@ -175,6 +187,7 @@ public function should_invoke_callable_with_parameters_indexed_by_name()
175187 /**
176188 * @test
177189 */
190+ #[\PHPUnit \Framework \Attributes \Test]
178191 public function should_invoke_callable_with_default_value_for_undefined_parameters ()
179192 {
180193 $ parameters = [
@@ -192,6 +205,7 @@ public function should_invoke_callable_with_default_value_for_undefined_paramete
192205 /**
193206 * @test
194207 */
208+ #[\PHPUnit \Framework \Attributes \Test]
195209 public function should_invoke_callable_with_null_for_nullable_parameters ()
196210 {
197211 $ result = $ this ->invoker ->call (function (?string $ baz = null ) {
@@ -238,6 +252,7 @@ public function should_invoke_callable_with_optional_parameter_before_required_p
238252 /**
239253 * @test
240254 */
255+ #[\PHPUnit \Framework \Attributes \Test]
241256 public function should_do_dependency_injection_with_typehint_container_resolver ()
242257 {
243258 $ resolver = new TypeHintContainerResolver ($ this ->container );
@@ -256,6 +271,7 @@ public function should_do_dependency_injection_with_typehint_container_resolver(
256271 /**
257272 * @test
258273 */
274+ #[\PHPUnit \Framework \Attributes \Test]
259275 public function should_do_dependency_injection_with_parameter_name_container_resolver ()
260276 {
261277 $ resolver = new ParameterNameContainerResolver ($ this ->container );
@@ -274,6 +290,7 @@ public function should_do_dependency_injection_with_parameter_name_container_res
274290 /**
275291 * @test
276292 */
293+ #[\PHPUnit \Framework \Attributes \Test]
277294 public function should_resolve_callable_from_container ()
278295 {
279296 $ callable = new CallableSpy ;
@@ -287,6 +304,7 @@ public function should_resolve_callable_from_container()
287304 /**
288305 * @test
289306 */
307+ #[\PHPUnit \Framework \Attributes \Test]
290308 public function should_resolve_array_callable_from_container ()
291309 {
292310 $ fixture = new InvokerTestFixture ;
@@ -301,6 +319,7 @@ public function should_resolve_array_callable_from_container()
301319 /**
302320 * @test
303321 */
322+ #[\PHPUnit \Framework \Attributes \Test]
304323 public function should_resolve_callable_from_container_with_scope_resolution_syntax ()
305324 {
306325 $ fixture = new InvokerTestFixture ;
@@ -315,6 +334,7 @@ public function should_resolve_callable_from_container_with_scope_resolution_syn
315334 /**
316335 * @test
317336 */
337+ #[\PHPUnit \Framework \Attributes \Test]
318338 public function should_resolve_array_callable_from_container_with_class_name ()
319339 {
320340 $ fixture = new InvokerTestFixture ;
@@ -329,6 +349,7 @@ public function should_resolve_array_callable_from_container_with_class_name()
329349 /**
330350 * @test
331351 */
352+ #[\PHPUnit \Framework \Attributes \Test]
332353 public function should_resolve_callable_from_container_with_class_name_in_scope_resolution_syntax ()
333354 {
334355 $ fixture = new InvokerTestFixture ;
@@ -366,6 +387,7 @@ public function positioned_parameters_have_the_highest_priority()
366387 /**
367388 * @test
368389 */
390+ #[\PHPUnit \Framework \Attributes \Test]
369391 public function should_not_invoke_statically_a_non_static_method ()
370392 {
371393 $ this ->expectExceptionMessage ('Cannot call foo() on Invoker\Test\InvokerTestFixture because it is not a class nor a valid container entry ' );
@@ -376,6 +398,7 @@ public function should_not_invoke_statically_a_non_static_method()
376398 /**
377399 * @test
378400 */
401+ #[\PHPUnit \Framework \Attributes \Test]
379402 public function should_throw_if_calling_non_callable_without_container ()
380403 {
381404 $ this ->expectExceptionMessage ("'foo' is not a callable " );
@@ -387,6 +410,7 @@ public function should_throw_if_calling_non_callable_without_container()
387410 /**
388411 * @test
389412 */
413+ #[\PHPUnit \Framework \Attributes \Test]
390414 public function should_throw_if_calling_non_callable_without_container_2 ()
391415 {
392416 $ this ->expectExceptionMessage ('NULL is not a callable ' );
@@ -398,6 +422,7 @@ public function should_throw_if_calling_non_callable_without_container_2()
398422 /**
399423 * @test
400424 */
425+ #[\PHPUnit \Framework \Attributes \Test]
401426 public function should_throw_if_calling_non_callable_with_container ()
402427 {
403428 $ this ->expectExceptionMessage ("'foo' is neither a callable nor a valid container entry " );
@@ -409,6 +434,7 @@ public function should_throw_if_calling_non_callable_with_container()
409434 /**
410435 * @test
411436 */
437+ #[\PHPUnit \Framework \Attributes \Test]
412438 public function should_throw_if_calling_non_callable_object ()
413439 {
414440 $ this ->expectExceptionMessage ('Instance of stdClass is not a callable ' );
@@ -420,6 +446,7 @@ public function should_throw_if_calling_non_callable_object()
420446 /**
421447 * @test
422448 */
449+ #[\PHPUnit \Framework \Attributes \Test]
423450 public function should_invoke_static_method_rather_than_resolving_entry_from_container ()
424451 {
425452 // Register a non-callable so that test fails if we try to invoke that
@@ -434,6 +461,7 @@ public function should_invoke_static_method_rather_than_resolving_entry_from_con
434461 /**
435462 * @test
436463 */
464+ #[\PHPUnit \Framework \Attributes \Test]
437465 public function should_throw_if_no_value_for_optional_parameter_1 ()
438466 {
439467 $ this ->expectExceptionMessage ('Unable to invoke the callable because no value was given for parameter 2 ($bar) ' );
@@ -449,6 +477,7 @@ public function should_throw_if_no_value_for_optional_parameter_1()
449477 /**
450478 * @test
451479 */
480+ #[\PHPUnit \Framework \Attributes \Test]
452481 public function should_throw_if_no_value_for_optional_parameter_2 ()
453482 {
454483 $ this ->expectExceptionMessage ('Unable to invoke the callable because no value was given for parameter 2 ($bar) ' );
@@ -465,6 +494,7 @@ public function should_throw_if_no_value_for_optional_parameter_2()
465494 /**
466495 * @test
467496 */
497+ #[\PHPUnit \Framework \Attributes \Test]
468498 public function should_invoke_callable_with_variadic_parameter ()
469499 {
470500 $ callable = function (...$ param ) {
@@ -533,4 +563,3 @@ public static function __callStatic(string $name, array $args): string
533563 throw new Exception ('Unknown method ' );
534564 }
535565}
536-
0 commit comments