summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-09-02 18:23:09 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-09-02 18:23:19 -0400
commitf0f2d939087b2349a4f3250afc17162194bd5c6a (patch)
tree67f348968faacb24f461b45a73d828c58d80e80d /tests
parenta77c16371ff8f01f57cfd110b8a277dcdf23ef82 (diff)
downloadnextcloud-server-f0f2d939087b2349a4f3250afc17162194bd5c6a.tar.gz
nextcloud-server-f0f2d939087b2349a4f3250afc17162194bd5c6a.zip
Restructure generateTarget for the post_addToGroup hook
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/share/share.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index 18ca5031ca4..082e265571b 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -366,21 +366,22 @@ class Test_Share extends UnitTestCase {
$this->assertEqual(count($to_test), 2);
$this->assertTrue(in_array('test.txt', $to_test));
$this->assertTrue(in_array('test1.txt', $to_test));
- //$this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array('test.txt', 'test1.txt'));
-// // Valid reshare TODO Broken
-// $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_SHARE));
-// OC_User::setUserId($this->user4);
-// $this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array('test1.txt'));
-//
-// // Remove user from group
-// OC_Group::removeFromGroup($this->user2, $this->group1);
-// OC_User::setUserId($this->user2);
-// $this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array('test.txt'));
-// OC_User::setUserId($this->user4);
-// $this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array());
+ // Valid reshare
+ $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_SHARE));
+ OC_User::setUserId($this->user4);
+ $this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array('test1.txt'));
+
+ // Remove user from group
+ OC_Group::removeFromGroup($this->user2, $this->group1);
+ OC_User::setUserId($this->user2);
+ $this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array('test.txt'));
+ OC_User::setUserId($this->user4);
+ $this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array());
// Add user to group
+ OC_Group::addToGroup($this->user4, $this->group1);
+ $this->assertEqual(OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET), array('test.txt'));
// Remove group
}