diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-06 16:07:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-06 16:07:31 +0100 |
commit | 5411d60b249cc12b429ed8083e7f34d1415d278e (patch) | |
tree | f50b1b15040a14a663427b6868c111c7176a5eb2 /apps/user_ldap/tests/User_ProxyTest.php | |
parent | 0256f68c4909ecacc1b2b515253523809a870868 (diff) | |
parent | fa565750d1f94f9d3f7e2229e7ec7aadd0d06063 (diff) | |
download | nextcloud-server-5411d60b249cc12b429ed8083e7f34d1415d278e.tar.gz nextcloud-server-5411d60b249cc12b429ed8083e7f34d1415d278e.zip |
Merge pull request #5321 from coletivoEITA/user_ldap_plugins_structure
Implement plugins infrastructure in User_LDAP
Diffstat (limited to 'apps/user_ldap/tests/User_ProxyTest.php')
-rw-r--r-- | apps/user_ldap/tests/User_ProxyTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/user_ldap/tests/User_ProxyTest.php b/apps/user_ldap/tests/User_ProxyTest.php index 68b1e4428ca..f6aaa01cb8d 100644 --- a/apps/user_ldap/tests/User_ProxyTest.php +++ b/apps/user_ldap/tests/User_ProxyTest.php @@ -2,6 +2,9 @@ /** * @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch> * + * @author Lukas Reschke <lukas@statuscode.ch> + * @author Vinicius Brand <vinicius@eita.org.br> + * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify @@ -21,8 +24,10 @@ namespace OCA\User_LDAP\Tests; +use OCA\User_LDAP\ILDAPUserPlugin; use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\User_Proxy; +use OCA\User_LDAP\UserPluginManager; use OCP\IConfig; use OCP\IUserSession; use OCP\Notification\IManager as INotificationManager; @@ -39,6 +44,8 @@ class User_ProxyTest extends TestCase { private $userSession; /** @var User_Proxy|\PHPUnit_Framework_MockObject_MockObject */ private $proxy; + /** @var UserPluginManager|\PHPUnit_Framework_MockObject_MockObject */ + private $userPluginManager; public function setUp() { parent::setUp(); @@ -47,6 +54,7 @@ class User_ProxyTest extends TestCase { $this->config = $this->createMock(IConfig::class); $this->notificationManager = $this->createMock(INotificationManager::class); $this->userSession = $this->createMock(IUserSession::class); + $this->userPluginManager = $this->createMock(UserPluginManager::class); $this->proxy = $this->getMockBuilder(User_Proxy::class) ->setConstructorArgs([ [], @@ -54,6 +62,7 @@ class User_ProxyTest extends TestCase { $this->config, $this->notificationManager, $this->userSession, + $this->userPluginManager ]) ->setMethods(['handleRequest']) ->getMock(); @@ -68,4 +77,23 @@ class User_ProxyTest extends TestCase { $this->assertTrue($this->proxy->setPassword('MyUid', 'MyPassword')); } + + public function testSetDisplayName() { + $this->proxy + ->expects($this->once()) + ->method('handleRequest') + ->with('MyUid', 'setDisplayName', ['MyUid', 'MyPassword']) + ->willReturn(true); + + $this->assertTrue($this->proxy->setDisplayName('MyUid', 'MyPassword')); } + + public function testCreateUser() { + $this->proxy + ->expects($this->once()) + ->method('handleRequest') + ->with('MyUid', 'createUser', ['MyUid', 'MyPassword']) + ->willReturn(true); + + $this->assertTrue($this->proxy->createUser('MyUid', 'MyPassword')); + } } |