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 29 global $USERINFO; 30 $USERINFO['grps']=[]; 31 32 33 $request = new TestRequest(); 34 $queryParams['call'] = action_plugin_api::PLUGIN_NAME; 35 return $request->get($queryParams, '/lib/exe/ajax.php'); 36 37 } 38 39 40 41 42} 43