diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-11 13:01:37 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-11 13:01:37 +0200 |
commit | 21481208830bae4ebb1a700246a91a43c66bbecc (patch) | |
tree | de7c4919e6f828fe118dd776206381ea46a276b6 /apps/provisioning_api | |
parent | 4bffe393e95fe65d55c9c85b62687421d7556072 (diff) | |
download | nextcloud-server-21481208830bae4ebb1a700246a91a43c66bbecc.tar.gz nextcloud-server-21481208830bae4ebb1a700246a91a43c66bbecc.zip |
[provisioning api] Test for correct displayname
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r-- | apps/provisioning_api/lib/users.php | 2 | ||||
-rw-r--r-- | apps/provisioning_api/tests/userstest.php | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/apps/provisioning_api/lib/users.php b/apps/provisioning_api/lib/users.php index 359400b029d..e53d21937de 100644 --- a/apps/provisioning_api/lib/users.php +++ b/apps/provisioning_api/lib/users.php @@ -130,7 +130,7 @@ class Users { $data = self::fillStorageInfo($userId, $data); $data['enabled'] = $this->config->getUserValue($userId, 'core', 'enabled', 'true'); $data['email'] = $this->config->getUserValue($userId, 'settings', 'email'); - $data['displayname'] = $this->userManager->get($parameters['userid']); + $data['displayname'] = $this->userManager->get($parameters['userid'])->getDisplayName(); // Return the appropriate data $responseData = array(); diff --git a/apps/provisioning_api/tests/userstest.php b/apps/provisioning_api/tests/userstest.php index d91160fc53a..6dd4f623f93 100644 --- a/apps/provisioning_api/tests/userstest.php +++ b/apps/provisioning_api/tests/userstest.php @@ -162,12 +162,15 @@ class UsersTest extends TestCase { public function testGetUserOnSelf() { $user = $this->generateUsers(); + $user->setDisplayName('foobar'); $this->userSession->setUser($user); $params['userid'] = $user->getUID(); $result = $this->api->getUser($params); $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertTrue($result->succeeded()); $data = $result->getData(); + + $this->assertEquals('foobar', $data['displayname']); } public function testGetUserOnNonExistingUser() { |