diff options
Diffstat (limited to 'tests/plugins')
-rw-r--r-- | tests/plugins/test/test.php | 16 | ||||
-rw-r--r-- | tests/plugins/test_route_invalid/test_route_invalid.php | 12 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/plugins/test/test.php b/tests/plugins/test/test.php index 03be4f4e..34cd339e 100644 --- a/tests/plugins/test/test.php +++ b/tests/plugins/test/test.php | |||
@@ -27,3 +27,19 @@ function hook_test_error() | |||
27 | { | 27 | { |
28 | new Unknown(); | 28 | new Unknown(); |
29 | } | 29 | } |
30 | |||
31 | function test_register_routes(): array | ||
32 | { | ||
33 | return [ | ||
34 | [ | ||
35 | 'method' => 'GET', | ||
36 | 'route' => '/test', | ||
37 | 'callable' => 'getFunction', | ||
38 | ], | ||
39 | [ | ||
40 | 'method' => 'POST', | ||
41 | 'route' => '/custom', | ||
42 | 'callable' => 'postFunction', | ||
43 | ], | ||
44 | ]; | ||
45 | } | ||
diff --git a/tests/plugins/test_route_invalid/test_route_invalid.php b/tests/plugins/test_route_invalid/test_route_invalid.php new file mode 100644 index 00000000..0c5a5101 --- /dev/null +++ b/tests/plugins/test_route_invalid/test_route_invalid.php | |||
@@ -0,0 +1,12 @@ | |||
1 | <?php | ||
2 | |||
3 | function test_route_invalid_register_routes(): array | ||
4 | { | ||
5 | return [ | ||
6 | [ | ||
7 | 'method' => 'GET', | ||
8 | 'route' => 'not a route', | ||
9 | 'callable' => 'getFunction', | ||
10 | ], | ||
11 | ]; | ||
12 | } | ||