Skip to content

Commit

Permalink
Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Ras authored and Martijn Ras committed Feb 13, 2015
1 parent e4729a0 commit 188eedd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions _test/tests/inc/remote.test.php
Expand Up @@ -157,6 +157,8 @@ function test_pluginMethods() {
}

function test_hasAccessSuccess() {
global $conf;
$conf['remoteuser'] = '';
$this->assertTrue($this->remote->hasAccess());
}

Expand Down Expand Up @@ -203,6 +205,7 @@ function test_hasAccessFailAcl2() {
function test_forceAccessSuccess() {
global $conf;
$conf['remote'] = 1;
$conf['remoteuser'] = '';
$this->remote->forceAccess(); // no exception should occur
}

Expand All @@ -217,7 +220,11 @@ function test_forceAccessFail() {

function test_generalCoreFunctionWithoutArguments() {
global $conf;
global $USERINFO;
$conf['remote'] = 1;
$conf['remoteuser'] = '';
$conf['useacl'] = 1;
$USERINFO['grps'] = array('grp');
$remoteApi = new RemoteApi();
$remoteApi->getCoreMethods(new RemoteAPICoreTest());

Expand All @@ -243,7 +250,10 @@ function test_generalCoreFunctionOnArgumentMismatch() {

function test_generalCoreFunctionWithArguments() {
global $conf;
global $USERINFO;
$conf['remote'] = 1;
$conf['remoteuser'] = '';
$conf['useacl'] = 1;

$remoteApi = new RemoteApi();
$remoteApi->getCoreMethods(new RemoteAPICoreTest());
Expand All @@ -256,7 +266,10 @@ function test_generalCoreFunctionWithArguments() {

function test_pluginCallMethods() {
global $conf;
global $USERINFO;
$conf['remote'] = 1;
$conf['remoteuser'] = '';
$conf['useacl'] = 1;

$remoteApi = new RemoteApi();
$this->assertEquals($remoteApi->call('plugin.testplugin.method1'), null);
Expand Down Expand Up @@ -313,6 +326,11 @@ function test_publicCallPluginDeny() {
}

function test_pluginCallCustomPath() {
global $conf;
global $USERINFO;
$conf['remote'] = 1;
$conf['remoteuser'] = '';
$conf['useacl'] = 1;
global $EVENT_HANDLER;
$EVENT_HANDLER->register_hook('RPC_CALL_ADD', 'BEFORE', $this, 'pluginCallCustomPathRegister');

Expand Down

0 comments on commit 188eedd

Please sign in to comment.