[provisioning api] Test for correct displayname

This commit is contained in:
Roeland Jago Douma 2015-08-11 13:01:37 +02:00
parent 4bffe393e9
commit 2148120883
3 changed files with 5 additions and 2 deletions

@ -1 +1 @@
Subproject commit c45d817921543d2f0562ac4f3be61404b1d4a35e
Subproject commit b94f7d38f6e13825fd34c7113827d3c369a689ad

View File

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

View File

@ -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() {