3
3
4
4
namespace Chimera \DependencyInjection \Tests \Functional ;
5
5
6
+ use Chimera \DependencyInjection as Services ;
6
7
use Chimera \DependencyInjection \Tests \Functional \App \CreateThing ;
7
8
use Chimera \DependencyInjection \Tests \Functional \App \CreateThingHandler ;
8
9
use Chimera \DependencyInjection \Tests \Functional \App \FetchThing ;
32
33
use Mezzio \Router \Middleware \MethodNotAllowedMiddleware ;
33
34
use Mezzio \Router \Route ;
34
35
use Mezzio \Router \RouteCollector ;
36
+ use PHPUnit \Framework \Attributes as PHPUnit ;
35
37
use Psr \Http \Server \MiddlewareInterface ;
36
38
use ReflectionProperty ;
37
39
use SplQueue ;
41
43
use function assert ;
42
44
use function iterator_to_array ;
43
45
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)]
58
58
final class ApplicationRegistrationTest extends ApplicationTestCase
59
59
{
60
- /** @test */
60
+ #[ PHPUnit \Test]
61
61
public function applicationMustBeCorrectlyRegistered (): void
62
62
{
63
63
$ container = $ this ->createContainer ();
@@ -66,7 +66,7 @@ public function applicationMustBeCorrectlyRegistered(): void
66
66
self ::assertInstanceOf (Application::class, $ container ->get ('sample-app.http ' ));
67
67
}
68
68
69
- /** @test */
69
+ #[ PHPUnit \Test]
70
70
public function routesMustBeProperlyDefined (): void
71
71
{
72
72
$ container = $ this ->createContainer ();
@@ -106,7 +106,7 @@ private static function assertRouteRegistered(
106
106
self ::assertSame ($ expectedName , $ match [0 ]->getName ());
107
107
}
108
108
109
- /** @test */
109
+ #[ PHPUnit \Test]
110
110
public function httpMiddlewaresMustBeProperlyDefined (): void
111
111
{
112
112
$ container = $ this ->createContainer ();
@@ -135,7 +135,6 @@ public function httpMiddlewaresMustBeProperlyDefined(): void
135
135
}
136
136
137
137
$ property = new ReflectionProperty (MiddlewarePipe::class, 'pipeline ' );
138
- $ property ->setAccessible (true );
139
138
140
139
$ result = $ container ->get ('sample-app.http.middleware_pipeline ' );
141
140
assert ($ result instanceof MiddlewarePipe);
@@ -148,7 +147,7 @@ public function httpMiddlewaresMustBeProperlyDefined(): void
148
147
self ::assertSame (iterator_to_array ($ expectedPipeline ), iterator_to_array ($ resultingPipeline ));
149
148
}
150
149
151
- /** @test */
150
+ #[ PHPUnit \Test]
152
151
public function serviceBusesMustExist (): void
153
152
{
154
153
$ container = $ this ->createContainer ();
@@ -157,7 +156,7 @@ public function serviceBusesMustExist(): void
157
156
self ::assertInstanceOf (ServiceBus::class, $ container ->get ('sample-app.query_bus ' ));
158
157
}
159
158
160
- /** @test */
159
+ #[ PHPUnit \Test]
161
160
public function commandBusHandlersMustBeProperlyDefined (): void
162
161
{
163
162
$ container = $ this ->createContainer ();
@@ -169,7 +168,7 @@ public function commandBusHandlersMustBeProperlyDefined(): void
169
168
self ::assertInstanceOf (RemoveThingHandler::class, $ locator ->getHandlerForCommand (RemoveThing::class));
170
169
}
171
170
172
- /** @test */
171
+ #[ PHPUnit \Test]
173
172
public function commandBusMiddlewareMustBeProperlyDefined (): void
174
173
{
175
174
$ container = $ this ->createContainer ();
@@ -187,7 +186,7 @@ public function commandBusMiddlewareMustBeProperlyDefined(): void
187
186
self ::assertEquals (new CommandBus ($ middlewareList ), $ bus ); // @phpstan-ignore-line
188
187
}
189
188
190
- /** @test */
189
+ #[ PHPUnit \Test]
191
190
public function queryBusHandlersMustBeProperlyDefined (): void
192
191
{
193
192
$ container = $ this ->createContainer ();
@@ -199,7 +198,7 @@ public function queryBusHandlersMustBeProperlyDefined(): void
199
198
self ::assertInstanceOf (ListThingsHandler::class, $ locator ->getHandlerForCommand (ListThings::class));
200
199
}
201
200
202
- /** @test */
201
+ #[ PHPUnit \Test]
203
202
public function queryBusMiddlewareMustBeProperlyDefined (): void
204
203
{
205
204
$ container = $ this ->createContainer ();
0 commit comments