Fix getCloudId
This commit is contained in:
parent
6abc02cb88
commit
0391cc0451
2 changed files with 8 additions and 1 deletions
|
@ -79,6 +79,7 @@ class User implements IUser {
|
|||
$this->emitter = $emitter;
|
||||
$this->config = $config;
|
||||
$this->avatarManager = $avatarManager;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
if ($this->config) {
|
||||
$enabled = $this->config->getUserValue($uid, 'core', 'enabled', 'true');
|
||||
$this->enabled = ($enabled === 'true');
|
||||
|
|
|
@ -468,8 +468,14 @@ class User extends \Test\TestCase {
|
|||
*/
|
||||
$backend = $this->getMock('\Test\Util\User\Dummy');
|
||||
$urlGenerator = $this->getMockBuilder('\OC\URLGenerator')
|
||||
->setMethods(['getAbsoluteURL'])
|
||||
->disableOriginalConstructor()->getMock();
|
||||
$urlGenerator
|
||||
->expects($this->any())
|
||||
->method('getAbsoluteURL')
|
||||
->withAnyParameters()
|
||||
->willReturn('http://localhost:8888/owncloud');
|
||||
$user = new \OC\User\User('foo', $backend, null, null, null, $urlGenerator);
|
||||
$this->assertEquals("foo@localhost", $user->getCloudId());
|
||||
$this->assertEquals("foo@localhost:8888/owncloud", $user->getCloudId());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue