summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-02 16:17:58 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-02 16:17:58 +0100
commitdf5872ec50a68de5d99bd6b5cf17ceb94f2ef833 (patch)
treeeedcfa1459f9cf6ef67bec10787883875ed1fc3f /tests
parentc35a450cb1c0df0f77dea4c69182a381543b679a (diff)
parent28ceab2f616d45a53dcc00c2cff53d5524bf0e9e (diff)
downloadnextcloud-server-df5872ec50a68de5d99bd6b5cf17ceb94f2ef833.tar.gz
nextcloud-server-df5872ec50a68de5d99bd6b5cf17ceb94f2ef833.zip
Merge pull request #20719 from owncloud/adding-system-addressbook-of-users
Adding system addressbook for users of this instance - a occ command …
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/contacts/localadressbook.php7
-rw-r--r--tests/lib/user/user.php24
2 files changed, 30 insertions, 1 deletions
diff --git a/tests/lib/contacts/localadressbook.php b/tests/lib/contacts/localadressbook.php
index 6bfcf3d890a..e5c43460835 100644
--- a/tests/lib/contacts/localadressbook.php
+++ b/tests/lib/contacts/localadressbook.php
@@ -98,6 +98,11 @@ class SimpleUserForTesting implements IUser {
}
public function getEMailAddress() {
- // TODO: Implement getEMailAddress() method.
+ }
+
+ public function getAvatarImage($size) {
+ }
+
+ public function getCloudId() {
}
}
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());
+ }
}