summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-10-09 17:16:59 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-10-09 17:16:59 -0400
commitdc767798c60a5934c43fce1877724dd56e6b6841 (patch)
treea02da33829472887acfdf1e592140d7455aa13c9 /tests
parent4e6f720f14c810b37289843539531c7ecb1fe573 (diff)
downloadnextcloud-server-dc767798c60a5934c43fce1877724dd56e6b6841.tar.gz
nextcloud-server-dc767798c60a5934c43fce1877724dd56e6b6841.zip
Manually change appconfig value for share policy so tests work correctly
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/share/share.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index b2fecdc8bf7..f0b5f120584 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -264,6 +264,8 @@ class Test_Share extends UnitTestCase {
} catch (Exception $exception) {
$this->assertEqual($exception->getMessage(), $message);
}
+ $policy = OC_Appconfig::getValue('core', 'shareapi_share_policy', 'global');
+ OC_Appconfig::setValue('core', 'shareapi_share_policy', 'groups_only');
$message = 'Sharing test.txt failed, because '.$this->user1.' is not a member of the group '.$this->group2;
try {
OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group2, OCP\Share::PERMISSION_READ);
@@ -271,6 +273,7 @@ class Test_Share extends UnitTestCase {
} catch (Exception $exception) {
$this->assertEqual($exception->getMessage(), $message);
}
+ OC_Appconfig::setValue('core', 'shareapi_share_policy', $policy);
// Valid share
$this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\Share::PERMISSION_READ));