Fixed tests

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-05-17 12:48:26 +02:00
parent 10c135ca34
commit 97af7566e4
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
2 changed files with 25 additions and 2 deletions

View File

@ -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());
}

View File

@ -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
*