diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-01 11:22:09 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-02 09:14:41 +0100 |
commit | fe67db1ad0efc6a703a752ef22ee7098519c69c4 (patch) | |
tree | daf16ca7c555395a78a9cf2b73495cad37bb5e77 /tests/lib/user | |
parent | 599ba31edcfc3cd9ffa659257c1686d6d5a73af0 (diff) | |
download | nextcloud-server-fe67db1ad0efc6a703a752ef22ee7098519c69c4.tar.gz nextcloud-server-fe67db1ad0efc6a703a752ef22ee7098519c69c4.zip |
Adding unit test for User::getCloudId()
Diffstat (limited to 'tests/lib/user')
-rw-r--r-- | tests/lib/user/user.php | 18 |
1 files changed, 18 insertions, 0 deletions
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()); + } } |