From 97af7566e4f9e703d096e4fae3ab8c60304627aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Thu, 17 May 2018 12:48:26 +0200 Subject: [PATCH] Fixed tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .../tests/Controller/GroupsControllerTest.php | 20 +++++++++++++++++-- lib/public/IGroup.php | 7 +++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php index 44b440a40b..115c9c7ba4 100644 --- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php +++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php @@ -101,6 +101,12 @@ class GroupsControllerTest extends \Test\TestCase { $group ->method('getDisplayName') ->willReturn($gid.'-name'); + $group + ->method('count') + ->willReturn(123); + $group + ->method('countDisabled') + ->willReturn(11); return $group; } @@ -205,8 +211,18 @@ class GroupsControllerTest extends \Test\TestCase { $result = $this->api->getGroupsDetails($search, $limit, $offset); $this->assertEquals(['groups' => [ - Array('id' => 'group1', 'displayname' => 'group1-name'), - Array('id' => 'group2', 'displayname' => 'group2-name') + Array( + 'id' => 'group1', + 'displayname' => 'group1-name', + 'usercount' => 123, + 'disabled' => 11 + ), + Array( + 'id' => 'group2', + 'displayname' => 'group2-name', + 'usercount' => 123, + 'disabled' => 11 + ) ]], $result->getData()); } diff --git a/lib/public/IGroup.php b/lib/public/IGroup.php index da1a4f5dd1..436338b4ac 100644 --- a/lib/public/IGroup.php +++ b/lib/public/IGroup.php @@ -100,6 +100,13 @@ interface IGroup { */ public function count($search = ''); + /** + * returns the number of disabled users + * + * @return int|bool + */ + public function countDisabled(); + /** * search for users in the group by displayname *