]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/plugins/test/test.php
Merge pull request #1664 from ArthurHoaro/fix/metadata-sync
[github/shaarli/Shaarli.git] / tests / plugins / test / test.php
index 2aaf51223e326e108451b0ba77b026db7828b6d0..34cd339e1a8cb84409f689d3a48f67dbb5124744 100644 (file)
@@ -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',
+        ],
+    ];
+}