diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-10-20 22:56:25 +0400 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-10-20 22:56:25 +0400 |
commit | adbaaf85ea92c57b0845f6e4c855a8fdd62eebe6 (patch) | |
tree | 1ad84046aee59f78513ba85fa730a83a9e56baae /tests | |
parent | 701009bd72829b6ccd58f934c3f9d0db905c82a0 (diff) |
Test that dispayNamesInGroup(s) always returns uid as key in the result array
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/group.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/group.php b/tests/lib/group.php index d2c9ce46148..8de8d033e19 100644 --- a/tests/lib/group.php +++ b/tests/lib/group.php @@ -109,6 +109,24 @@ class Test_Group extends PHPUnit_Framework_TestCase { $this->assertEquals(array(), OC_Group::getGroups()); } + public function testDisplayNamesInGroup() { + OC_Group::useBackend(new OC_Group_Dummy()); + $userBackend = new \OC_User_Dummy(); + \OC_User::getManager()->registerBackend($userBackend); + + $group1 = uniqid(); + $user1 = 'uid1'; + $user2 = 'uid2'; + OC_Group::createGroup($group1); + $userBackend->createUser($user1, ''); + $userBackend->createUser($user2, ''); + OC_Group::addToGroup($user1, $group1); + OC_Group::addToGroup($user2, $group1); + //Dummy backend does not support setting displaynames, uid will always + //be returned. This checks primarily, that the return format is okay. + $expected = array($user1 => $user1, $user2 => $user2); + $this->assertEquals($expected, OC_Group::displayNamesInGroup($group1)); + } public function testUsersInGroup() { OC_Group::useBackend(new OC_Group_Dummy()); |