1<?php
2
3
4/**
5 * Static Test Utility Function
6 */
7class dokuwiki_plugin_api_util
8{
9
10    /**
11     * @var JSON
12     */
13    public static $JSON;
14    public static $PLUGIN_INFO;
15
16    static function init(){
17        self::$JSON = new JSON(JSON_LOOSE_TYPE);
18        $file = __DIR__ . '/../plugin.info.txt';
19        self::$PLUGIN_INFO = confToHash($file);
20    }
21
22    /**
23     * A wrapper around a call to the rest api
24     * @param $queryParams - An array representing the query string
25     * @return TestResponse - A response
26     */
27    public static function getRequest($queryParams=array()):TestResponse {
28        $request = new TestRequest();
29        $queryParams['call'] = action_plugin_api::PLUGIN_NAME;
30        $testResponse = $request->get($queryParams, '/lib/exe/ajax.php');
31        return $testResponse;
32
33    }
34
35
36
37
38}
39