From 391531851cb73d7f6e7f989f481772f09f9f00a6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 May 2016 16:25:14 +0200 Subject: [PATCH] Move interface to PSR-4 --- apps/user_ldap/lib/Group_Proxy.php | 2 -- apps/user_ldap/lib/{ildapwrapper.php => ILDAPWrapper.php} | 2 +- apps/user_ldap/lib/LDAP.php | 1 - apps/user_ldap/lib/LDAPUtility.php | 2 -- apps/user_ldap/lib/Proxy.php | 1 - apps/user_ldap/lib/User_Proxy.php | 1 - apps/user_ldap/lib/Wizard.php | 1 - apps/user_ldap/lib/access.php | 1 + apps/user_ldap/lib/connection.php | 1 + apps/user_ldap/tests/GroupLDAPTest.php | 3 +-- apps/user_ldap/tests/User/ManagerTest.php | 2 +- apps/user_ldap/tests/User/UserTest.php | 2 +- apps/user_ldap/tests/User_LDAPTest.php | 3 +-- apps/user_ldap/tests/WizardTest.php | 6 +++--- apps/user_ldap/tests/access.php | 3 +-- apps/user_ldap/tests/connection.php | 6 +++--- 16 files changed, 14 insertions(+), 23 deletions(-) rename apps/user_ldap/lib/{ildapwrapper.php => ILDAPWrapper.php} (99%) diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php index b038c487a07..333a74bab22 100644 --- a/apps/user_ldap/lib/Group_Proxy.php +++ b/apps/user_ldap/lib/Group_Proxy.php @@ -24,8 +24,6 @@ namespace OCA\User_LDAP; -use OCA\user_ldap\lib\ILDAPWrapper; - class Group_Proxy extends Proxy implements \OCP\GroupInterface { private $backends = array(); private $refBackend = null; diff --git a/apps/user_ldap/lib/ildapwrapper.php b/apps/user_ldap/lib/ILDAPWrapper.php similarity index 99% rename from apps/user_ldap/lib/ildapwrapper.php rename to apps/user_ldap/lib/ILDAPWrapper.php index d607a3fdb66..a95f3a615f2 100644 --- a/apps/user_ldap/lib/ildapwrapper.php +++ b/apps/user_ldap/lib/ILDAPWrapper.php @@ -23,7 +23,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; interface ILDAPWrapper { diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php index 221f3c8883b..a7033d82254 100644 --- a/apps/user_ldap/lib/LDAP.php +++ b/apps/user_ldap/lib/LDAP.php @@ -27,7 +27,6 @@ namespace OCA\User_LDAP; use OC\ServerNotAvailableException; -use OCA\user_ldap\lib\ILDAPWrapper; class LDAP implements ILDAPWrapper { protected $curFunc = ''; diff --git a/apps/user_ldap/lib/LDAPUtility.php b/apps/user_ldap/lib/LDAPUtility.php index 6328feee240..33b2685593f 100644 --- a/apps/user_ldap/lib/LDAPUtility.php +++ b/apps/user_ldap/lib/LDAPUtility.php @@ -23,8 +23,6 @@ namespace OCA\User_LDAP; -use OCA\user_ldap\lib\ILDAPWrapper; - abstract class LDAPUtility { protected $ldap; diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index 783d8f9373c..bf4083fdb18 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -31,7 +31,6 @@ namespace OCA\User_LDAP; use OCA\user_ldap\lib\Access; use OCA\user_ldap\lib\Connection; use OCA\user_ldap\lib\FilesystemHelper; -use OCA\user_ldap\lib\ILDAPWrapper; use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\GroupMapping; diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php index c4337d80d0b..800d1d36c16 100644 --- a/apps/user_ldap/lib/User_Proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -26,7 +26,6 @@ namespace OCA\User_LDAP; -use OCA\user_ldap\lib\ILDAPWrapper; use OCA\User_LDAP\User\User; use OCP\IConfig; diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index 981d6ecc2ec..a94d3174c4e 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -35,7 +35,6 @@ use OC\ServerNotAvailableException; use OCA\user_ldap\lib\Access; use OCA\user_ldap\lib\Configuration; use OCA\user_ldap\lib\Helper; -use OCA\user_ldap\lib\ILDAPWrapper; class Wizard extends LDAPUtility { static protected $l; diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 2d7a7db356d..355ce7c681e 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -37,6 +37,7 @@ namespace OCA\user_ldap\lib; +use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\LDAPUtility; use OCA\User_LDAP\User\IUserTools; use OCA\User_LDAP\User\Manager; diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index d3a4a9763d0..f3e39d4fb0b 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -29,6 +29,7 @@ namespace OCA\user_ldap\lib; use OC\ServerNotAvailableException; +use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\LDAPUtility; /** diff --git a/apps/user_ldap/tests/GroupLDAPTest.php b/apps/user_ldap/tests/GroupLDAPTest.php index 02392e6e610..f4185b2ae3a 100644 --- a/apps/user_ldap/tests/GroupLDAPTest.php +++ b/apps/user_ldap/tests/GroupLDAPTest.php @@ -29,7 +29,6 @@ namespace OCA\User_LDAP\Tests; use OCA\User_LDAP\Group_LDAP as GroupLDAP; use \OCA\user_ldap\lib\Access; use \OCA\user_ldap\lib\Connection; -use \OCA\user_ldap\lib\ILDAPWrapper; /** * Class GroupLDAPTest @@ -47,7 +46,7 @@ class GroupLDAPTest extends \Test\TestCase { $conMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $connector = $this->getMock('\OCA\user_ldap\lib\Connection', $conMethods, array($lw, null, null)); diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php index 6dee5bd5c91..633cd0c876a 100644 --- a/apps/user_ldap/tests/User/ManagerTest.php +++ b/apps/user_ldap/tests/User/ManagerTest.php @@ -47,7 +47,7 @@ class ManagerTest extends \Test\TestCase { $userMgr = $this->getMock('\OCP\IUserManager'); $connection = new \OCA\user_ldap\lib\Connection( - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'), + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'), '', null ); diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index 2a5a7cc6a77..9afdb7c8645 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -61,7 +61,7 @@ class UserTest extends \Test\TestCase { unset($accMethods[array_search('getConnection', $accMethods)]); $umMethods = get_class_methods('\OCA\User_LDAP\User\Manager'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $im = $this->getMock('\OCP\Image'); if (is_null($userMgr)) { $userMgr = $this->getMock('\OCP\IUserManager'); diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index d67dafb90eb..f13240aa248 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -30,7 +30,6 @@ namespace OCA\User_LDAP\Tests; use OCA\User_LDAP\User_LDAP as UserLDAP; use \OCA\user_ldap\lib\Access; use \OCA\user_ldap\lib\Connection; -use \OCA\user_ldap\lib\ILDAPWrapper; /** * Class Test_User_Ldap_Direct @@ -65,7 +64,7 @@ class User_LDAPTest extends \Test\TestCase { unset($uMethods[array_search('getDN', $uMethods)]); unset($uMethods[array_search('__construct', $uMethods)]); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $connector = $this->getMock('\OCA\user_ldap\lib\Connection', $conMethods, array($lw, null, null)); diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php index 83cd58d2231..f74defa8ae2 100644 --- a/apps/user_ldap/tests/WizardTest.php +++ b/apps/user_ldap/tests/WizardTest.php @@ -27,10 +27,10 @@ namespace OCA\User_LDAP\tests; use \OCA\User_LDAP\Wizard; -// use \OCA\user_ldap\User_LDAP as UserLDAP; +// use \OCA\User_LDAP\User_LDAP as UserLDAP; // use \OCA\user_ldap\lib\Access; // use \OCA\user_ldap\lib\Configuration; -// use \OCA\user_ldap\lib\ILDAPWrapper; +// use \OCA\User_LDAP\ILDAPWrapper; /** * Class Test_Wizard @@ -63,7 +63,7 @@ class WizardTest extends \Test\TestCase { $connMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $conf = $this->getMock('\OCA\user_ldap\lib\Configuration', $confMethods, array($lw, null, null)); diff --git a/apps/user_ldap/tests/access.php b/apps/user_ldap/tests/access.php index ef5c09393b8..75bf4b7524d 100644 --- a/apps/user_ldap/tests/access.php +++ b/apps/user_ldap/tests/access.php @@ -27,7 +27,6 @@ namespace OCA\user_ldap\tests; use \OCA\user_ldap\lib\Access; use \OCA\user_ldap\lib\Connection; -use \OCA\user_ldap\lib\ILDAPWrapper; /** * Class Test_Access @@ -47,7 +46,7 @@ class Test_Access extends \Test\TestCase { $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); $umMethods = get_class_methods('\OCA\User_LDAP\User\Manager'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $connector = $this->getMock('\OCA\user_ldap\lib\Connection', $conMethods, array($lw, null, null)); diff --git a/apps/user_ldap/tests/connection.php b/apps/user_ldap/tests/connection.php index a6ccf4b340b..e93009ee8ff 100644 --- a/apps/user_ldap/tests/connection.php +++ b/apps/user_ldap/tests/connection.php @@ -33,7 +33,7 @@ use OCA\user_ldap\lib\Connection; * @package OCA\user_ldap\tests */ class Test_Connection extends \Test\TestCase { - /** @var \OCA\user_ldap\lib\ILDAPWrapper */ + /** @var \OCA\User_LDAP\ILDAPWrapper */ protected $ldap; /** @var Connection */ @@ -42,7 +42,7 @@ class Test_Connection extends \Test\TestCase { public function setUp() { parent::setUp(); - $this->ldap = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $this->ldap = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); // we use a mock here to replace the cache mechanism, due to missing DI in LDAP backend. $this->connection = $this->getMockBuilder('OCA\user_ldap\lib\Connection') ->setMethods(['getFromCache', 'writeToCache']) @@ -58,7 +58,7 @@ class Test_Connection extends \Test\TestCase { //background: upon login a bind is done with the user credentials //which is valid for the whole LDAP resource. It needs to be reset //to the agent's credentials - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $connection = new Connection($lw, '', null); $agent = array( -- 2.39.5