diff --git a/tests/Integration/config/5.4/routes/controllers.yaml b/tests/Integration/config/5.4/routes/controllers.yaml index 561f7c4..0d66ff6 100644 --- a/tests/Integration/config/5.4/routes/controllers.yaml +++ b/tests/Integration/config/5.4/routes/controllers.yaml @@ -1,26 +1,3 @@ -archive: - path: /archive - controller: Presta\SitemapBundle\Tests\Integration\Controller\ArchivesController::archive - -blog_read: - path: /blog - controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::read - options: - sitemap: - section: blog - -blog_post: - path: /blog/{slug} - controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::post - -dispatch_message: - path: /dispatch-message - controller: Presta\SitemapBundle\Tests\Integration\Controller\MessengerController::dispatch - -home: - path: / - controller: Presta\SitemapBundle\Tests\Integration\Controller\StaticController::home - options: - sitemap: - section: static - +controllers: + resource: ../../../src/Controller/ + type: annotation diff --git a/tests/Integration/config/5.4/special/annotations.yaml b/tests/Integration/config/5.4/special/annotations.yaml new file mode 100644 index 0000000..a37058c --- /dev/null +++ b/tests/Integration/config/5.4/special/annotations.yaml @@ -0,0 +1,2 @@ +framework: + annotations: true diff --git a/tests/Integration/config/6.1/routes/controllers.yaml b/tests/Integration/config/6.1/routes/controllers.yaml index ecfb1ff..0d66ff6 100644 --- a/tests/Integration/config/6.1/routes/controllers.yaml +++ b/tests/Integration/config/6.1/routes/controllers.yaml @@ -1,25 +1,3 @@ -archive: - path: /archive - controller: Presta\SitemapBundle\Tests\Integration\Controller\ArchivesController::archive - -blog_read: - path: /blog - controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::read - options: - sitemap: - section: blog - -blog_post: - path: /blog/{slug} - controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::post - -dispatch_message: - path: /dispatch-message - controller: Presta\SitemapBundle\Tests\Integration\Controller\MessengerController::dispatch - -home: - path: / - controller: Presta\SitemapBundle\Tests\Integration\Controller\StaticController::home - options: - sitemap: - section: static +controllers: + resource: ../../../src/Controller/ + type: annotation diff --git a/tests/Integration/config/6.3/routes/controllers.yaml b/tests/Integration/config/6.3/routes/controllers.yaml index 561f7c4..0d66ff6 100644 --- a/tests/Integration/config/6.3/routes/controllers.yaml +++ b/tests/Integration/config/6.3/routes/controllers.yaml @@ -1,26 +1,3 @@ -archive: - path: /archive - controller: Presta\SitemapBundle\Tests\Integration\Controller\ArchivesController::archive - -blog_read: - path: /blog - controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::read - options: - sitemap: - section: blog - -blog_post: - path: /blog/{slug} - controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::post - -dispatch_message: - path: /dispatch-message - controller: Presta\SitemapBundle\Tests\Integration\Controller\MessengerController::dispatch - -home: - path: / - controller: Presta\SitemapBundle\Tests\Integration\Controller\StaticController::home - options: - sitemap: - section: static - +controllers: + resource: ../../../src/Controller/ + type: annotation diff --git a/tests/Integration/config/6.4/routes/annotations.yaml b/tests/Integration/config/6.4/routes/controllers.yaml similarity index 100% rename from tests/Integration/config/6.4/routes/annotations.yaml rename to tests/Integration/config/6.4/routes/controllers.yaml diff --git a/tests/Integration/config/7.0/routes/annotations.yaml b/tests/Integration/config/7.0/routes/controllers.yaml similarity index 100% rename from tests/Integration/config/7.0/routes/annotations.yaml rename to tests/Integration/config/7.0/routes/controllers.yaml diff --git a/tests/Integration/src/Controller/ArchivesController.php b/tests/Integration/src/Controller/ArchivesController.php index 878ead7..838cba8 100644 --- a/tests/Integration/src/Controller/ArchivesController.php +++ b/tests/Integration/src/Controller/ArchivesController.php @@ -16,6 +16,9 @@ final class ArchivesController { + /** + * @Route("/archive", name="archive") + */ #[Route(path: '/archive', name: 'archive')] public function archive(): Response { diff --git a/tests/Integration/src/Controller/BlogController.php b/tests/Integration/src/Controller/BlogController.php index 4ed716a..cf4fe1c 100644 --- a/tests/Integration/src/Controller/BlogController.php +++ b/tests/Integration/src/Controller/BlogController.php @@ -16,12 +16,18 @@ final class BlogController { + /** + * @Route("/blog", name="blog_read", options={"sitemap"={"section"="blog"}}) + */ #[Route(path: '/blog', name: 'blog_read', options: ['sitemap' => ['section' => 'blog']])] public function read(): Response { return new Response(__FUNCTION__); } + /** + * @Route("/blog/{slug}", name="blog_post") + */ #[Route(path: '/blog/{slug}', name: 'blog_post')] public function post(string $slug): Response { diff --git a/tests/Integration/src/Controller/MessengerController.php b/tests/Integration/src/Controller/MessengerController.php index 5b9b870..d78006c 100644 --- a/tests/Integration/src/Controller/MessengerController.php +++ b/tests/Integration/src/Controller/MessengerController.php @@ -19,6 +19,9 @@ final class MessengerController { + /** + * @Route("/dispatch-message", name="dispatch_message") + */ #[Route(path: '/dispatch-message', name: 'dispatch_message')] public function dispatch(Request $request, MessageBusInterface $bus): Response { diff --git a/tests/Integration/src/Controller/StaticController.php b/tests/Integration/src/Controller/StaticController.php index 7c3684b..17d8147 100644 --- a/tests/Integration/src/Controller/StaticController.php +++ b/tests/Integration/src/Controller/StaticController.php @@ -16,6 +16,9 @@ final class StaticController { + /** + * @Route("", name="home", options={"sitemap"={"section"="static"}}) + */ #[Route(path: '', name: 'home', options: ['sitemap' => ['section' => 'static']])] public function home(): Response { diff --git a/tests/Integration/src/Kernel.php b/tests/Integration/src/Kernel.php index 3cc74ef..9063e40 100644 --- a/tests/Integration/src/Kernel.php +++ b/tests/Integration/src/Kernel.php @@ -48,6 +48,9 @@ private function configureContainer( $version = sprintf('%s.%s', BaseKernel::MAJOR_VERSION, BaseKernel::MINOR_VERSION); $container->import('../config/' . $version . '/*.yaml'); $container->import('../config/services.yaml'); + if (\PHP_VERSION_ID < 80000) { + $container->import('../config/' . $version . '/special/annotations.yaml'); + } } private function configureRoutes(RoutingConfigurator $routes): void