X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fplugins%2Ftest%2Ftest.php;h=34cd339e1a8cb84409f689d3a48f67dbb5124744;hb=bd11879018416d2c5d87728bb0be6ee0cf54451a;hp=ae5032dd36a5b19fc999c387c008ff781481c70c;hpb=46237c97884458b1a75ae871264cd3fb54f8cd74;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/plugins/test/test.php b/tests/plugins/test/test.php index ae5032dd..34cd339e 100644 --- a/tests/plugins/test/test.php +++ b/tests/plugins/test/test.php @@ -13,6 +13,9 @@ function hook_test_random($data) $data[1] = 'page test'; } elseif (isset($data['_LOGGEDIN_']) && $data['_LOGGEDIN_'] === true) { $data[1] = 'loggedin'; + } elseif (array_key_exists('_LOGGEDIN_', $data)) { + $data[1] = 'loggedin'; + $data[2] = $data['_LOGGEDIN_']; } else { $data[1] = $data[0]; } @@ -24,3 +27,19 @@ function hook_test_error() { new Unknown(); } + +function test_register_routes(): array +{ + return [ + [ + 'method' => 'GET', + 'route' => '/test', + 'callable' => 'getFunction', + ], + [ + 'method' => 'POST', + 'route' => '/custom', + 'callable' => 'postFunction', + ], + ]; +}