From fe67db1ad0efc6a703a752ef22ee7098519c69c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Tue, 1 Dec 2015 11:22:09 +0100
Subject: [PATCH] Adding unit test for User::getCloudId()

---
 tests/lib/user/user.php | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/lib/user/user.php b/tests/lib/user/user.php
index bc1365d35bf..52f0a125303 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,15 @@ 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')
+				->disableOriginalConstructor()->getMock();
+		$user = new \OC\User\User('foo', $backend, null, null, null, $urlGenerator);
+		$this->assertEquals("foo@localhost", $user->getCloudId());
+	}
 }
-- 
GitLab