33
44namespace Chimera \DependencyInjection \Tests \Functional ;
55
6+ use Chimera \DependencyInjection as Services ;
67use Chimera \DependencyInjection \Tests \Functional \App \CreateThing ;
78use Chimera \DependencyInjection \Tests \Functional \App \CreateThingHandler ;
89use Chimera \DependencyInjection \Tests \Functional \App \FetchThing ;
3233use Mezzio \Router \Middleware \MethodNotAllowedMiddleware ;
3334use Mezzio \Router \Route ;
3435use Mezzio \Router \RouteCollector ;
36+ use PHPUnit \Framework \Attributes as PHPUnit ;
3537use Psr \Http \Server \MiddlewareInterface ;
3638use ReflectionProperty ;
3739use SplQueue ;
4143use function assert ;
4244use function iterator_to_array ;
4345
44- /**
45- * @covers \Chimera\DependencyInjection\Mapping\ExpandTags
46- * @covers \Chimera\DependencyInjection\Mapping\Package
47- * @covers \Chimera\DependencyInjection\MessageCreator\JmsSerializer\Package
48- * @covers \Chimera\DependencyInjection\Routing\ErrorHandling\Package
49- * @covers \Chimera\DependencyInjection\Routing\ErrorHandling\RegisterDefaultComponents
50- * @covers \Chimera\DependencyInjection\Routing\Mezzio\Package
51- * @covers \Chimera\DependencyInjection\Routing\Mezzio\RegisterServices
52- * @covers \Chimera\DependencyInjection\ServiceBus\Tactician\Package
53- * @covers \Chimera\DependencyInjection\ServiceBus\Tactician\RegisterServices
54- * @covers \Chimera\DependencyInjection\RegisterApplication
55- * @covers \Chimera\DependencyInjection\RegisterDefaultComponents
56- * @covers \Chimera\DependencyInjection\ValidateApplicationComponents
57- */
46+ #[PHPUnit \CoversClass(Services \Mapping \ExpandTags::class)]
47+ #[PHPUnit \CoversClass(Services \Mapping \Package::class)]
48+ #[PHPUnit \CoversClass(Services \MessageCreator \JmsSerializer \Package::class)]
49+ #[PHPUnit \CoversClass(Services \Routing \ErrorHandling \Package::class)]
50+ #[PHPUnit \CoversClass(Services \Routing \ErrorHandling \RegisterDefaultComponents::class)]
51+ #[PHPUnit \CoversClass(Services \Routing \Mezzio \Package::class)]
52+ #[PHPUnit \CoversClass(Services \Routing \Mezzio \RegisterServices::class)]
53+ #[PHPUnit \CoversClass(Services \ServiceBus \Tactician \Package::class)]
54+ #[PHPUnit \CoversClass(Services \ServiceBus \Tactician \RegisterServices::class)]
55+ #[PHPUnit \CoversClass(Services \RegisterApplication::class)]
56+ #[PHPUnit \CoversClass(Services \RegisterDefaultComponents::class)]
57+ #[PHPUnit \CoversClass(Services \ValidateApplicationComponents::class)]
5858final class ApplicationRegistrationTest extends ApplicationTestCase
5959{
60- /** @test */
60+ #[ PHPUnit \Test]
6161 public function applicationMustBeCorrectlyRegistered (): void
6262 {
6363 $ container = $ this ->createContainer ();
@@ -66,7 +66,7 @@ public function applicationMustBeCorrectlyRegistered(): void
6666 self ::assertInstanceOf (Application::class, $ container ->get ('sample-app.http ' ));
6767 }
6868
69- /** @test */
69+ #[ PHPUnit \Test]
7070 public function routesMustBeProperlyDefined (): void
7171 {
7272 $ container = $ this ->createContainer ();
@@ -106,7 +106,7 @@ private static function assertRouteRegistered(
106106 self ::assertSame ($ expectedName , $ match [0 ]->getName ());
107107 }
108108
109- /** @test */
109+ #[ PHPUnit \Test]
110110 public function httpMiddlewaresMustBeProperlyDefined (): void
111111 {
112112 $ container = $ this ->createContainer ();
@@ -135,7 +135,6 @@ public function httpMiddlewaresMustBeProperlyDefined(): void
135135 }
136136
137137 $ property = new ReflectionProperty (MiddlewarePipe::class, 'pipeline ' );
138- $ property ->setAccessible (true );
139138
140139 $ result = $ container ->get ('sample-app.http.middleware_pipeline ' );
141140 assert ($ result instanceof MiddlewarePipe);
@@ -148,7 +147,7 @@ public function httpMiddlewaresMustBeProperlyDefined(): void
148147 self ::assertSame (iterator_to_array ($ expectedPipeline ), iterator_to_array ($ resultingPipeline ));
149148 }
150149
151- /** @test */
150+ #[ PHPUnit \Test]
152151 public function serviceBusesMustExist (): void
153152 {
154153 $ container = $ this ->createContainer ();
@@ -157,7 +156,7 @@ public function serviceBusesMustExist(): void
157156 self ::assertInstanceOf (ServiceBus::class, $ container ->get ('sample-app.query_bus ' ));
158157 }
159158
160- /** @test */
159+ #[ PHPUnit \Test]
161160 public function commandBusHandlersMustBeProperlyDefined (): void
162161 {
163162 $ container = $ this ->createContainer ();
@@ -169,7 +168,7 @@ public function commandBusHandlersMustBeProperlyDefined(): void
169168 self ::assertInstanceOf (RemoveThingHandler::class, $ locator ->getHandlerForCommand (RemoveThing::class));
170169 }
171170
172- /** @test */
171+ #[ PHPUnit \Test]
173172 public function commandBusMiddlewareMustBeProperlyDefined (): void
174173 {
175174 $ container = $ this ->createContainer ();
@@ -187,7 +186,7 @@ public function commandBusMiddlewareMustBeProperlyDefined(): void
187186 self ::assertEquals (new CommandBus ($ middlewareList ), $ bus ); // @phpstan-ignore-line
188187 }
189188
190- /** @test */
189+ #[ PHPUnit \Test]
191190 public function queryBusHandlersMustBeProperlyDefined (): void
192191 {
193192 $ container = $ this ->createContainer ();
@@ -199,7 +198,7 @@ public function queryBusHandlersMustBeProperlyDefined(): void
199198 self ::assertInstanceOf (ListThingsHandler::class, $ locator ->getHandlerForCommand (ListThings::class));
200199 }
201200
202- /** @test */
201+ #[ PHPUnit \Test]
203202 public function queryBusMiddlewareMustBeProperlyDefined (): void
204203 {
205204 $ container = $ this ->createContainer ();
0 commit comments