X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fplugins%2Ftest%2Ftest.php;h=34cd339e1a8cb84409f689d3a48f67dbb5124744;hb=a6e9c08499f9f79dad88cb3ae9eacda0e0c34c96;hp=2aaf51223e326e108451b0ba77b026db7828b6d0;hpb=9b2bd66fb60ffd5a833480bf329062c7d57bc8c4;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/plugins/test/test.php b/tests/plugins/test/test.php index 2aaf5122..34cd339e 100644 --- a/tests/plugins/test/test.php +++ b/tests/plugins/test/test.php @@ -13,9 +13,33 @@ 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]; } return $data; } + +function hook_test_error() +{ + new Unknown(); +} + +function test_register_routes(): array +{ + return [ + [ + 'method' => 'GET', + 'route' => '/test', + 'callable' => 'getFunction', + ], + [ + 'method' => 'POST', + 'route' => '/custom', + 'callable' => 'postFunction', + ], + ]; +}