diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-19 22:23:02 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-19 22:23:02 +0100 |
commit | 870bc429b26460734da900ccbab1b760fb9dcb08 (patch) | |
tree | 09edaa801208c6d44cf7159382823c636eb8feb4 /apps/files_encryption/tests | |
parent | cbffaff7a00e9d029969d63f795d38a464448dfc (diff) | |
parent | 730460c9fa758ae2968299d9dcfa82c23e83f5bb (diff) | |
download | nextcloud-server-870bc429b26460734da900ccbab1b760fb9dcb08.tar.gz nextcloud-server-870bc429b26460734da900ccbab1b760fb9dcb08.zip |
Merge pull request #13416 from owncloud/reauthenticate-if-session-differs-from-basic-auth
Prioritise Basic Auth header over Cookie
Diffstat (limited to 'apps/files_encryption/tests')
-rwxr-xr-x | apps/files_encryption/tests/webdav.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php index 83f4c0a77de..bdbc9d7ef02 100755 --- a/apps/files_encryption/tests/webdav.php +++ b/apps/files_encryption/tests/webdav.php @@ -206,12 +206,17 @@ class Webdav extends TestCase { * handle webdav request * * @param bool $body - * * @note this init procedure is copied from /apps/files/appinfo/remote.php */ function handleWebdavRequest($body = false) { // Backends - $authBackend = new \OC_Connector_Sabre_Auth(); + $authBackend = $this->getMockBuilder('OC_Connector_Sabre_Auth') + ->setMethods(['validateUserPass']) + ->getMock(); + $authBackend->expects($this->any()) + ->method('validateUserPass') + ->will($this->returnValue(true)); + $lockBackend = new \OC_Connector_Sabre_Locks(); $requestBackend = new \OC_Connector_Sabre_Request(); @@ -236,6 +241,10 @@ class Webdav extends TestCase { $server->addPlugin(new \OC_Connector_Sabre_MaintenancePlugin()); $server->debugExceptions = true; + // Totally ugly hack to setup the FS + \OC::$server->getUserSession()->login($this->userId, $this->userId); + \OC_Util::setupFS($this->userId); + // And off we go! if ($body) { $server->httpRequest->setBody($body); |