blob: 992b17bc65ae5b2237365762951ee14526c5f025 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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'));
}
}
|