diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-10-13 15:34:40 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-10-13 15:34:40 +0200 |
commit | a49d571799566d6b0e980a6dc73e641c07cc395d (patch) | |
tree | ca5926c688f32843333b25160c5cbb5f13eea424 /apps/user_ldap/tests/AccessTest.php | |
parent | c4fcd1f282132cdea2cb97c162b2b461e022390a (diff) | |
download | nextcloud-server-a49d571799566d6b0e980a6dc73e641c07cc395d.tar.gz nextcloud-server-a49d571799566d6b0e980a6dc73e641c07cc395d.zip |
fix and tidy up tests after merge conflicts
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests/AccessTest.php')
-rw-r--r-- | apps/user_ldap/tests/AccessTest.php | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index f7b6fa36334..d7d04e31d08 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -27,9 +27,12 @@ namespace OCA\User_LDAP\Tests; use OCA\User_LDAP\Access; +use OCA\User_LDAP\Connection; use OCA\User_LDAP\FilesystemHelper; +use OCA\User_LDAP\Helper; use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\LogWrapper; +use OCA\User_LDAP\User\Manager; use OCP\IAvatarManager; use OCP\IConfig; use OCP\IDBConnection; @@ -45,32 +48,21 @@ use OCP\IUserManager; */ class AccessTest extends \Test\TestCase { private function getConnectorAndLdapMock() { - static $conMethods; - static $accMethods; - static $umMethods; - - if(is_null($conMethods) || is_null($accMethods)) { - $conMethods = get_class_methods('\OCA\User_LDAP\Connection'); - $accMethods = get_class_methods('\OCA\User_LDAP\Access'); - $umMethods = get_class_methods('\OCA\User_LDAP\User\Manager'); - } $lw = $this->createMock(ILDAPWrapper::class); - $connector = $this->getMockBuilder('\OCA\User_LDAP\Connection') - ->setMethods($conMethods) + $connector = $this->getMockBuilder(Connection::class) ->setConstructorArgs([$lw, null, null]) ->getMock(); - $um = $this->getMockBuilder('\OCA\User_LDAP\User\Manager') + $um = $this->getMockBuilder(Manager::class) + ->setConstructorArgs([ $this->createMock(IConfig::class), $this->createMock(FilesystemHelper::class), $this->createMock(LogWrapper::class), $this->createMock(IAvatarManager::class), $this->createMock(Image::class), $this->createMock(IDBConnection::class), - $this->createMock(IUserManager::class))); - $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig()); - $this->createMock('\OCP\IUserManager') - ]) + $this->createMock(IUserManager::class)]) ->getMock(); + $helper = new Helper(\OC::$server->getConfig()); return array($lw, $connector, $um, $helper); } |