diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-11-06 18:31:33 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-11-06 18:31:41 +0100 |
commit | 0f3fd89f7db7e636ec3d27da83b5390238165315 (patch) | |
tree | cc99b0380cc2e1d8b4eb553dc29f10f318c5824d /apps | |
parent | c21d1da01a9a5fb81d75b42c4c514743dc827caa (diff) | |
download | nextcloud-server-0f3fd89f7db7e636ec3d27da83b5390238165315.tar.gz nextcloud-server-0f3fd89f7db7e636ec3d27da83b5390238165315.zip |
Fix sharing tests
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/tests/api.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/tests/sharedmount.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/tests/testcase.php | 10 |
3 files changed, 15 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php index 88acbd8e775..453133fee31 100644 --- a/apps/files_sharing/tests/api.php +++ b/apps/files_sharing/tests/api.php @@ -35,6 +35,9 @@ class Test_Files_Sharing_Api extends TestCase { function setUp() { parent::setUp(); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no'); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_expire_after_n_days', '7'); + $this->folder = self::TEST_FOLDER_NAME; $this->subfolder = '/subfolder_share_api_test'; $this->subsubfolder = '/subsubfolder_share_api_test'; diff --git a/apps/files_sharing/tests/sharedmount.php b/apps/files_sharing/tests/sharedmount.php index e991d381e14..6d155f174ba 100644 --- a/apps/files_sharing/tests/sharedmount.php +++ b/apps/files_sharing/tests/sharedmount.php @@ -226,6 +226,10 @@ class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase { } class DummyTestClassSharedMount extends \OCA\Files_Sharing\SharedMount { + public function __construct($storage, $mountpoint, $arguments = null, $loader = null){ + // noop + } + public function stripUserFilesPathDummy($path) { return $this->stripUserFilesPath($path); } diff --git a/apps/files_sharing/tests/testcase.php b/apps/files_sharing/tests/testcase.php index 70cd45a8185..78277dc907f 100644 --- a/apps/files_sharing/tests/testcase.php +++ b/apps/files_sharing/tests/testcase.php @@ -72,8 +72,14 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { $backend->createUser(self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER3); // create group - \OC_Group::createGroup(self::TEST_FILES_SHARING_API_GROUP1); - \OC_Group::addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1); + $groupBackend = new \OC_Group_Dummy(); + $groupBackend->createGroup(self::TEST_FILES_SHARING_API_GROUP1); + $groupBackend->createGroup('group'); + $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER1, 'group'); + $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, 'group'); + $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group'); + $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1); + \OC_Group::useBackend($groupBackend); } |