@@ -85,6 +85,10 @@ private function createGroup($gid) {
8585 $ group
8686 ->method ('getGID ' )
8787 ->willReturn ($ gid );
88+ $ group
89+ ->method ('getDisplayName ' )
90+ ->willReturn ($ gid .'-name ' );
91+
8892 return $ group ;
8993 }
9094
@@ -165,6 +169,33 @@ public function testGetGroups($search, $limit, $offset) {
165169
166170 $ result = $ this ->api ->getGroups ($ search , $ limit , $ offset );
167171 $ this ->assertEquals (['groups ' => ['group1 ' , 'group2 ' ]], $ result ->getData ());
172+
173+ }
174+
175+ /**
176+ * @dataProvider dataGetGroups
177+ *
178+ * @param string|null $search
179+ * @param int|null $limit
180+ * @param int|null $offset
181+ */
182+ public function testGetGroupsDetails ($ search , $ limit , $ offset ) {
183+ $ groups = [$ this ->createGroup ('group1 ' ), $ this ->createGroup ('group2 ' )];
184+
185+ $ search = $ search === null ? '' : $ search ;
186+
187+ $ this ->groupManager
188+ ->expects ($ this ->once ())
189+ ->method ('search ' )
190+ ->with ($ search , $ limit , $ offset )
191+ ->willReturn ($ groups );
192+
193+ $ result = $ this ->api ->getGroupsDetails ($ search , $ limit , $ offset );
194+ $ this ->assertEquals (['groups ' => [
195+ Array ('id ' => 'group1 ' , 'displayname ' => 'group1-name ' ),
196+ Array ('id ' => 'group2 ' , 'displayname ' => 'group2-name ' )
197+ ]], $ result ->getData ());
198+
168199 }
169200
170201 public function testGetGroupAsSubadmin () {
0 commit comments