fix XMLRPC server tests
[dokuwiki.git] / _test / tests / Remote / Mock / ApiCore.php
blob503b5f5a7ba34f15fda7c6ad1ec0d961a8cacad8
1 <?php
3 namespace dokuwiki\test\Remote\Mock;
6 use dokuwiki\Remote\ApiCall;
7 use dokuwiki\Remote\Response\Link;
9 class ApiCore
12 function getMethods()
14 return [
15 'wiki.stringTestMethod' => new ApiCall([$this, 'stringTestMethod']),
16 'wiki.intTestMethod' => new ApiCall([$this, 'intTestMethod']),
17 'wiki.floatTestMethod' => new ApiCall([$this, 'floatTestMethod']),
18 'wiki.dateTestMethod' => new ApiCall([$this, 'dateTestMethod']),
19 'wiki.fileTestMethod' => new ApiCall([$this, 'fileTestMethod']),
20 'wiki.voidTestMethod' => new ApiCall([$this, 'voidTestMethod']),
21 'wiki.oneStringArgMethod' => new ApiCall([$this, 'oneStringArgMethod']),
22 'wiki.twoArgMethod' => new ApiCall([$this, 'twoArgMethod']),
23 'wiki.twoArgWithDefaultArg' => new ApiCall([$this, 'twoArgWithDefaultArg']),
24 'wiki.publicCall' => (new ApiCall([$this, 'publicCall']))->setPublic(),
25 'wiki.getStructuredData' => (new ApiCall([$this, 'getStructuredData'])),
29 function stringTestMethod()
31 return 'success';
34 function intTestMethod()
36 return 42;
39 function floatTestMethod()
41 return 3.14159265;
44 function dateTestMethod()
46 return 2623452346;
49 function fileTestMethod()
51 return 'file content';
54 function voidTestMethod()
56 return null;
59 function oneStringArgMethod($arg)
61 return $arg;
64 function twoArgMethod($string, $int)
66 return array($string, $int);
69 function twoArgWithDefaultArg($string1, $string2 = 'default')
71 return array($string1, $string2);
74 function publicCall()
76 return true;
79 function getStructuredData()
81 return new Link('internal', 'wiki:dokuwiki', 'https://www.dokuwiki.org/wiki:dokuwiki');