Lines Matching +full:- +full:- +full:global
25 global $plugin_controller;
26 global $conf;
27 global $USERINFO;
28 global $auth;
33 $pluginManager = $this->createMock('dokuwiki\Extension\PluginController');
34 $pluginManager->method('getList')->willReturn(array('testplugin', 'testplugin2'));
35 $pluginManager->method('load')->willReturnCallback(
50 $this->userinfo = $USERINFO;
51 $this->remote = new Api();
58 global $USERINFO;
59 $USERINFO = $this->userinfo;
65 $methods = $this->remote->getPluginMethods();
78 $this->assertEquals($expect, $actual);
83 $methods = $this->remote->getPluginMethods();
84 $this->assertEquals(
108 $methods['plugin.testplugin2.commented']->getArgs()
111 $this->assertEquals(
116 $methods['plugin.testplugin2.commented']->getReturn()
119 $this->assertEquals(0, $methods['plugin.testplugin2.commented']->isPublic());
120 $this->assertStringContainsString(
122 $methods['plugin.testplugin2.commented']->getSummary()
128 global $conf;
131 $this->remote->ensureAccessIsAllowed(new ApiCall('time'));
132 $this->assertTrue(true);
137 global $conf;
140 $this->expectException(AccessDeniedException::class);
141 $this->remote->ensureAccessIsAllowed(new ApiCall('time'));
146 global $conf;
150 $this->remote->ensureAccessIsAllowed(new ApiCall('time'));
151 $this->assertTrue(true);
156 global $conf;
157 global $USERINFO;
162 $this->remote->ensureAccessIsAllowed(new ApiCall('time'));
163 $this->assertTrue(true);
168 global $conf;
169 global $USERINFO;
174 $this->expectException(AccessDeniedException::class);
175 $this->remote->ensureAccessIsAllowed(new ApiCall('time'));
180 global $conf;
182 $this->expectException(AccessDeniedException::class);
183 $this->remote->ensureApiIsEnabled();
188 global $conf;
190 $this->expectException(AccessDeniedException::class);
191 $this->remote->ensureApiIsEnabled();
196 global $conf;
199 $this->remote->ensureApiIsEnabled();
200 $this->assertTrue(true);
206 global $conf;
207 global $USERINFO;
213 $remoteApi->getCoreMethods(new ApiCore());
215 $this->assertEquals($remoteApi->call('wiki.stringTestMethod'), 'success');
216 $this->assertEquals($remoteApi->call('wiki.intTestMethod'), 42);
217 $this->assertEquals($remoteApi->call('wiki.floatTestMethod'), 3.14159265);
218 $this->assertEquals($remoteApi->call('wiki.dateTestMethod'), 2623452346);
219 $this->assertEquals($remoteApi->call('wiki.fileTestMethod'), 'file content');
220 $this->assertEquals($remoteApi->call('wiki.voidTestMethod'), null);
225 global $conf;
228 $remoteApi->getCoreMethods(new ApiCore());
231 $remoteApi->call('wiki.voidTestMethod', array('something'));
232 $this->fail('Expects RemoteException to be raised');
234 $this->assertEquals(-32604, $th->getCode());
240 global $conf;
241 global $USERINFO;
247 $remoteApi->getCoreMethods(new ApiCore());
249 $this->assertEquals($remoteApi->call('wiki.oneStringArgMethod', array('string')), 'string');
250 …$this->assertEquals($remoteApi->call('wiki.twoArgMethod', array('string', 1)), array('string', 1));
251 …$this->assertEquals($remoteApi->call('wiki.twoArgWithDefaultArg', array('string')), array('string'…
252 …$this->assertEquals($remoteApi->call('wiki.twoArgWithDefaultArg', array('string', 'another')), arr…
257 global $conf;
261 $remoteApi->getCoreMethods(new ApiCore());
263 $this->expectException(RemoteException::class);
264 $this->expectExceptionCode(-32602);
266 $remoteApi->call('wiki.twoArgWithDefaultArg', array());
271 global $conf;
272 global $USERINFO;
278 $this->assertEquals($remoteApi->call('plugin.testplugin.method1'), null);
279 …$this->assertEquals($remoteApi->call('plugin.testplugin.method2', array('string', 7)), array('stri…
280 …$this->assertEquals($remoteApi->call('plugin.testplugin.method2ext', array('string', 7, true)), ar…
281 $this->assertEquals($remoteApi->call('plugin.testplugin.methodString'), 'success');
286 global $conf;
290 $remoteApi->getCoreMethods(new ApiCore());
292 $this->expectException(RemoteException::class);
293 $this->expectExceptionCode(-32602);
294 $remoteApi->call('plugin.testplugin.method2', array());
299 global $conf;
303 $this->expectException(RemoteException::class);
304 $this->expectExceptionCode(-32603);
307 $remoteApi->call('does.not exist'); // unknown method type
312 global $conf;
317 $remoteApi->getCoreMethods(new ApiCore());
318 $this->assertTrue($remoteApi->call('wiki.publicCall'));
323 global $conf;
328 $this->assertTrue($remoteApi->call('plugin.testplugin.publicCall'));
333 global $conf;
335 $this->expectException(AccessDeniedException::class);
337 $remoteApi->getCoreMethods(new ApiCore());
338 $remoteApi->call('wiki.stringTestMethod');
343 global $conf;
345 $this->expectException(AccessDeniedException::class);
347 $remoteApi->call('plugin.testplugin.methodString');