summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--settings/controller/userscontroller.php2
-rw-r--r--tests/settings/controller/userscontrollertest.php17
2 files changed, 15 insertions, 4 deletions
diff --git a/settings/controller/userscontroller.php b/settings/controller/userscontroller.php
index dbd8118375a..579d38f7091 100644
--- a/settings/controller/userscontroller.php
+++ b/settings/controller/userscontroller.php
@@ -91,7 +91,7 @@ class UsersController extends Controller {
*/
private function getUsersForUID(array $userIDs) {
$users = [];
- foreach ($userIDs as $uid) {
+ foreach ($userIDs as $uid => $displayName) {
$users[] = $this->userManager->get($uid);
}
return $users;
diff --git a/tests/settings/controller/userscontrollertest.php b/tests/settings/controller/userscontrollertest.php
index 78b855fd3f1..89ef8bcf8a6 100644
--- a/tests/settings/controller/userscontrollertest.php
+++ b/tests/settings/controller/userscontrollertest.php
@@ -126,9 +126,20 @@ class UsersControllerTest extends \Test\TestCase {
->method('getUserGroupIds')
->will($this->onConsecutiveCalls(array('Users', 'Support'), array('admins', 'Support'), array('External Users')));
$this->container['UserManager']
- ->expects($this->exactly(3))
+ ->expects($this->at(0))
+ ->method('get')
+ ->with('foo')
+ ->will($this->returnValue($foo));
+ $this->container['UserManager']
+ ->expects($this->at(1))
+ ->method('get')
+ ->with('admin')
+ ->will($this->returnValue($admin));
+ $this->container['UserManager']
+ ->expects($this->at(2))
->method('get')
- ->will($this->onConsecutiveCalls($foo, $admin, $bar));
+ ->with('bar')
+ ->will($this->returnValue($bar));
$this->container['Config']
->expects($this->exactly(3))
->method('getUserValue')
@@ -168,7 +179,7 @@ class UsersControllerTest extends \Test\TestCase {
),
)
);
- $response = $this->usersController->index(0, 10, 'pattern');
+ $response = $this->usersController->index(0, 10, 'gid', 'pattern');
$this->assertEquals($expectedResponse, $response);
}