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/lib/group | |
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/lib/group')
-rw-r--r-- | tests/lib/group/metadata.php | 9 |
1 files changed, 5 insertions, 4 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()) |