diff --git a/_test/mock/AuthCaseInsensitivePlugin.php b/_test/mock/AuthCaseInsensitivePlugin.php new file mode 100644 index 000000000..cf71c0c8c --- /dev/null +++ b/_test/mock/AuthCaseInsensitivePlugin.php @@ -0,0 +1,12 @@ +cando['delUser'] = $canDeleteUser; + } + + public function checkPass($user, $pass) { + return $pass == 'password'; + } + + public function deleteUsers($users) { + return in_array($_SERVER['REMOTE_USER'], $users); + } + + public function logoff() { + $this->loggedOff = true; + } + +} \ No newline at end of file diff --git a/_test/tests/inc/auth_aclcheck_caseinsensitive.test.php b/_test/tests/inc/auth_aclcheck_caseinsensitive.test.php index 644675de4..af0f17223 100644 --- a/_test/tests/inc/auth_aclcheck_caseinsensitive.test.php +++ b/_test/tests/inc/auth_aclcheck_caseinsensitive.test.php @@ -1,12 +1,6 @@ oldAuth = $auth; $this->oldAuthAcl = $AUTH_ACL; - $auth = new auth_acl_caseinsensitive_auth(); + $auth = new AuthCaseInsensitivePlugin(); } function tearDown() { diff --git a/_test/tests/inc/auth_admincheck.test.php b/_test/tests/inc/auth_admincheck.test.php index 82ddafcff..23e9b0035 100644 --- a/_test/tests/inc/auth_admincheck.test.php +++ b/_test/tests/inc/auth_admincheck.test.php @@ -1,12 +1,7 @@ cando['delUser'] = $canDeleteUser; - } - - public function checkPass($user, $pass) { - return $pass == 'password'; - } - - public function deleteUsers($users) { - return in_array($_SERVER['REMOTE_USER'], $users); - } - - public function logoff() { - $this->loggedOff = true; - } - -} +use dokuwiki\test\mock\AuthDeletePlugin; class auth_deleteprofile_test extends DokuWikiTest { @@ -56,7 +34,7 @@ class auth_deleteprofile_test extends DokuWikiTest { $_REQUEST = $input; $INPUT = new Input(); - $auth = new auth_deleteprofile_test_AuthDelete(); + $auth = new AuthDeletePlugin(); $this->assertTrue(auth_deleteprofile()); $this->assertTrue($auth->loggedOff); @@ -82,7 +60,7 @@ class auth_deleteprofile_test extends DokuWikiTest { $_REQUEST = $input; $INPUT = new Input(); - $auth = new auth_deleteprofile_test_AuthDelete(); + $auth = new AuthDeletePlugin(); // password check required - it fails, so don't delete profile $this->assertFalse(auth_deleteprofile()); @@ -112,7 +90,7 @@ class auth_deleteprofile_test extends DokuWikiTest { $_REQUEST = $input; $INPUT = new Input(); - $auth = new auth_deleteprofile_test_AuthDelete(false); + $auth = new AuthDeletePlugin(false); $conf['disableactions'] = ''; $this->assertFalse(auth_deleteprofile()); } @@ -136,7 +114,7 @@ class auth_deleteprofile_test extends DokuWikiTest { $_REQUEST = $input; $INPUT = new Input(); - $auth = new auth_deleteprofile_test_AuthDelete(); + $auth = new AuthDeletePlugin(); $conf['disableactions'] = 'profile_delete'; $this->assertFalse(actionOK('profile_delete')); @@ -165,7 +143,7 @@ class auth_deleteprofile_test extends DokuWikiTest { $_REQUEST = $input; $input_foundation = new Input(); - $auth = new auth_deleteprofile_test_AuthDelete(); + $auth = new AuthDeletePlugin(); $INPUT = clone $input_foundation; $INPUT->remove('delete'); diff --git a/_test/tests/inc/remote.test.php b/_test/tests/inc/remote.test.php index 57bec8762..7f1ec4aff 100644 --- a/_test/tests/inc/remote.test.php +++ b/_test/tests/inc/remote.test.php @@ -1,14 +1,10 @@ userinfo = $USERINFO; $this->remote = new Api(); - $auth = new remote_test_MockAuthCase(); + $auth = new AuthPlugin(); } function tearDown() { diff --git a/_test/tests/inc/remoteapicore.test.php b/_test/tests/inc/remoteapicore.test.php index 606dc747c..e152d4ac5 100644 --- a/_test/tests/inc/remoteapicore.test.php +++ b/_test/tests/inc/remoteapicore.test.php @@ -3,6 +3,7 @@ use dokuwiki\Remote\Api; use dokuwiki\Remote\ApiCore; use dokuwiki\test\mock\AuthPlugin; +use dokuwiki\test\mock\AuthDeletePlugin; /** * Class remoteapicore_test @@ -452,7 +453,7 @@ You can use up to five different levels of', public function test_deleteUser() { global $conf, $auth; - $auth = new auth_deleteprofile_test_AuthDelete(); + $auth = new AuthDeletePlugin(); $conf['remote'] = 1; $conf['remoteuser'] = 'testuser'; $_SERVER['REMOTE_USER'] = 'testuser';