]> source.dussan.org Git - nextcloud-server.git/commitdiff
Manually change appconfig value for share policy so tests work correctly
authorMichael Gapczynski <mtgap@owncloud.com>
Tue, 9 Oct 2012 21:16:59 +0000 (17:16 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Tue, 9 Oct 2012 21:16:59 +0000 (17:16 -0400)
tests/lib/share/share.php

index b2fecdc8bf7a57b8da964dd355fe4d8c6f2c663b..f0b5f1205844cf36df6b3225a4a507be3ca20dec 100644 (file)
@@ -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));