summaryrefslogtreecommitdiffstats
path: root/tests/lib/user/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/user/user.php')
-rw-r--r--tests/lib/user/user.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/lib/user/user.php b/tests/lib/user/user.php
index bc1365d35bf..1f613edc4e6 100644
--- a/tests/lib/user/user.php
+++ b/tests/lib/user/user.php
@@ -11,6 +11,13 @@ namespace Test\User;
use OC\Hooks\PublicEmitter;
+/**
+ * Class User
+ *
+ * @group DB
+ *
+ * @package Test\User
+ */
class User extends \Test\TestCase {
public function testDisplayName() {
/**
@@ -454,4 +461,21 @@ class User extends \Test\TestCase {
$this->assertTrue($user->delete());
$this->assertEquals(2, $hooksCalled);
}
+
+ public function testGetCloudId() {
+ /**
+ * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ */
+ $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, $urlGenerator);
+ $this->assertEquals("foo@localhost:8888/owncloud", $user->getCloudId());
+ }
}