aboutsummaryrefslogtreecommitdiff
path: root/tests/Fixtures/RealisticPublicController.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Fixtures/RealisticPublicController.php')
-rw-r--r--tests/Fixtures/RealisticPublicController.php72
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/Fixtures/RealisticPublicController.php b/tests/Fixtures/RealisticPublicController.php
new file mode 100644
index 0000000..992b17b
--- /dev/null
+++ b/tests/Fixtures/RealisticPublicController.php
@@ -0,0 +1,72 @@
+<?php
+
+declare(strict_types=1);
+
+namespace BrettParson\MiniRoute\Tests\Fixtures;
+
+use BrettParson\MiniRoute\Attribute\Get;
+use BrettParson\MiniRoute\Http\RequestInterface;
+use BrettParson\MiniRoute\Http\ResponseInterface;
+
+/**
+ * Public half of the brett-parson.com route model (9 routes).
+ *
+ * Mirrors the real public/index.php table so the integration suite pins
+ * the compatibility the stress test proved.
+ */
+final class RealisticPublicController
+{
+ #[Get('/')]
+ public function home(): ResponseInterface
+ {
+ return new TestResponse(200, 'home');
+ }
+
+ #[Get('/health')]
+ public function health(): ResponseInterface
+ {
+ return new TestResponse(200, 'health');
+ }
+
+ #[Get('/entries')]
+ public function entries(): ResponseInterface
+ {
+ return new TestResponse(200, 'entries');
+ }
+
+ #[Get('/entries/{slug}')]
+ public function entryShow(RequestInterface $request): ResponseInterface
+ {
+ return new TestResponse(200, 'entry-show:' . $request->param('slug'));
+ }
+
+ #[Get('/feed.xml')]
+ public function feed(): ResponseInterface
+ {
+ return new TestResponse(200, 'feed');
+ }
+
+ #[Get('/robots.txt')]
+ public function robots(): ResponseInterface
+ {
+ return new TestResponse(200, 'robots');
+ }
+
+ #[Get('/sitemap.xml')]
+ public function sitemap(): ResponseInterface
+ {
+ return new TestResponse(200, 'sitemap');
+ }
+
+ #[Get('/notes')]
+ public function notes(): ResponseInterface
+ {
+ return new TestResponse(200, 'notes');
+ }
+
+ #[Get('/notes/{id}')]
+ public function noteShow(RequestInterface $request): ResponseInterface
+ {
+ return new TestResponse(200, 'note-show:' . $request->param('id'));
+ }
+}