From 7c35ac36c1dea2d6f26d8184dcbf1fe5afae59ac Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Wed, 21 Mar 2012 13:15:18 +0100 Subject: added RPC_CALL_ADD event. This event enables plugins to register custom method names. --- _test/cases/inc/remote.test.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '_test') diff --git a/_test/cases/inc/remote.test.php b/_test/cases/inc/remote.test.php index 186f8e65a..f03d13ce1 100644 --- a/_test/cases/inc/remote.test.php +++ b/_test/cases/inc/remote.test.php @@ -309,4 +309,16 @@ class remote_test extends UnitTestCase { $remoteApi->call('plugin.testplugin.methodString'); } + function test_pluginCallCustomPath() { + global $EVENT_HANDLER; + $EVENT_HANDLER->register_hook('RPC_CALL_ADD', 'BEFORE', &$this, 'pluginCallCustomPathRegister'); + + $remoteApi = new RemoteAPI(); + $result = $remoteApi->call('custom.path'); + $this->assertEqual($result, 'success'); + } + + function pluginCallCustomPathRegister(&$event, $param) { + $event->data['custom.path'] = array('testplugin', 'methodString'); + } } -- cgit v1.2.3