Commit 1efce85c authored by Vincent Petry's avatar Vincent Petry Committed by GitHub
Browse files

Merge pull request #26853 from owncloud/provisioningapi-homelocation

Add home storage location in provisioning API response
parents 97211f92 1d2e1ff1
......@@ -214,6 +214,7 @@ class Users {
$data['quota'] = $this->fillStorageInfo($userId);
$data['email'] = $targetUserObject->getEMailAddress();
$data['displayname'] = $targetUserObject->getDisplayName();
$data['home'] = $targetUserObject->getHome();
$data['two_factor_auth_enabled'] = $this->twoFactorAuthManager->isTwoFactorAuthenticated($targetUserObject) ? 'true' : 'false';
return new Result($data);
......
......@@ -697,6 +697,9 @@ class UsersTest extends OriginalTest {
$targetUser->expects($this->once())
->method('getEMailAddress')
->willReturn('demo@owncloud.org');
$targetUser->expects($this->once())
->method('getHome')
->willReturn('/var/ocdata/UserToGet');
$this->userSession
->expects($this->once())
->method('getUser')
......@@ -732,7 +735,8 @@ class UsersTest extends OriginalTest {
'quota' => ['DummyValue'],
'email' => 'demo@owncloud.org',
'displayname' => 'Demo User',
'two_factor_auth_enabled' => 'false'
'home' => '/var/ocdata/UserToGet',
'two_factor_auth_enabled' => 'false',
]
);
$this->assertEquals($expected, $this->api->getUser(['userid' => 'UserToGet']));
......@@ -746,9 +750,12 @@ class UsersTest extends OriginalTest {
->will($this->returnValue('subadmin'));
$targetUser = $this->createMock('OCP\IUser');
$targetUser
->expects($this->once())
->method('getEMailAddress')
->willReturn('demo@owncloud.org');
->expects($this->once())
->method('getEMailAddress')
->willReturn('demo@owncloud.org');
$targetUser->expects($this->once())
->method('getHome')
->willReturn('/var/ocdata/UserToGet');
$this->userSession
->expects($this->once())
->method('getUser')
......@@ -795,6 +802,7 @@ class UsersTest extends OriginalTest {
'enabled' => 'true',
'quota' => ['DummyValue'],
'email' => 'demo@owncloud.org',
'home' => '/var/ocdata/UserToGet',
'displayname' => 'Demo User',
'two_factor_auth_enabled' => 'false'
]
......@@ -847,6 +855,9 @@ class UsersTest extends OriginalTest {
->method('getUID')
->will($this->returnValue('subadmin'));
$targetUser = $this->createMock('OCP\IUser');
$targetUser->expects($this->once())
->method('getHome')
->willReturn('/var/ocdata/UserToGet');
$this->userSession
->expects($this->once())
->method('getUser')
......@@ -891,7 +902,8 @@ class UsersTest extends OriginalTest {
'quota' => ['DummyValue'],
'email' => 'subadmin@owncloud.org',
'displayname' => 'Subadmin User',
'two_factor_auth_enabled' => 'false'
'home' => '/var/ocdata/UserToGet',
'two_factor_auth_enabled' => 'false',
]);
$this->assertEquals($expected, $this->api->getUser(['userid' => 'subadmin']));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment