diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-05-18 12:23:12 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-05-18 12:55:19 +0200 |
commit | d683752b37dd2ed40cddbc446e326015b3036ad3 (patch) | |
tree | d1533bfe1706463397aa35df27c03ac9de78aafd /tests | |
parent | 73a3086945b41afa39debd89481c021934dedb67 (diff) | |
download | nextcloud-server-d683752b37dd2ed40cddbc446e326015b3036ad3.tar.gz nextcloud-server-d683752b37dd2ed40cddbc446e326015b3036ad3.zip |
Sort user groups by group name and hide the user count
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/group/metadata.php | 9 | ||||
-rw-r--r-- | tests/settings/controller/groupscontrollertest.php | 18 |
2 files changed, 14 insertions, 13 deletions
diff --git a/tests/lib/group/metadata.php b/tests/lib/group/metadata.php index 94944189cad..3f4019c2fac 100644 --- a/tests/lib/group/metadata.php +++ b/tests/lib/group/metadata.php @@ -16,7 +16,7 @@ class Test_MetaData extends \Test\TestCase { ->getMock(); } - private function getGroupMock() { + private function getGroupMock($countCallCount = 0) { $group = $this->getMockBuilder('\OC\Group\Group') ->disableOriginalConstructor() ->getMock(); @@ -28,7 +28,7 @@ class Test_MetaData extends \Test\TestCase { 'g2', 'g2', 'g2', 'g3', 'g3', 'g3')); - $group->expects($this->exactly(3)) + $group->expects($this->exactly($countCallCount)) ->method('count') ->with('') ->will($this->onConsecutiveCalls(2, 3, 5)); @@ -54,14 +54,15 @@ class Test_MetaData extends \Test\TestCase { $this->assertSame(2, count($ordinaryGroups)); $this->assertSame('g2', $ordinaryGroups[0]['name']); - $this->assertSame(3, $ordinaryGroups[0]['usercount']); + // user count is not loaded + $this->assertSame(0, $ordinaryGroups[0]['usercount']); } public function testGetWithSorting() { $groupManager = $this->getGroupManagerMock(); $groupMetaData = new \OC\Group\MetaData('foo', true, $groupManager); $groupMetaData->setSorting($groupMetaData::SORT_USERCOUNT); - $group = $this->getGroupMock(); + $group = $this->getGroupMock(3); $groups = array_fill(0, 3, $group); $groupManager->expects($this->once()) diff --git a/tests/settings/controller/groupscontrollertest.php b/tests/settings/controller/groupscontrollertest.php index 4b6c9d02566..3c15754846c 100644 --- a/tests/settings/controller/groupscontrollertest.php +++ b/tests/settings/controller/groupscontrollertest.php @@ -111,26 +111,26 @@ class GroupsControllerTest extends \Test\TestCase { 0 => array( 'id' => 'admin', 'name' => 'admin', - 'usercount' => 18 + 'usercount' => 0,//User count disabled 18, ) ), 'groups' => array( 0 => array( + 'id' => 'firstGroup', + 'name' => 'firstGroup', + 'usercount' => 0,//User count disabled 12, + ), + 1 => array( 'id' => 'secondGroup', 'name' => 'secondGroup', - 'usercount' => 25 + 'usercount' => 0,//User count disabled 25, ), - 1 => array( + 2 => array( 'id' => 'thirdGroup', 'name' => 'thirdGroup', - 'usercount' => 14 + 'usercount' => 0,//User count disabled 14, ), - 2 => array( - 'id' => 'firstGroup', - 'name' => 'firstGroup', - 'usercount' => 12 - ) ) ) ) |