Convert to using the newer Horde_Ldap. Does not really work completely yet but the...
authorGunnar Wrobel <wrobel@temple.(none)>
Wed, 10 Feb 2010 06:12:03 +0000 (07:12 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Wed, 17 Feb 2010 09:14:00 +0000 (10:14 +0100)
25 files changed:
framework/Kolab_Server/lib/Horde/Kolab/Server/Connection/Mock.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Connection/Mock/Ldap.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Connection/Mock/Search.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Connection/Simpleldap.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Connection/Splittedldap.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Decorator/Clean.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Decorator/Count.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Decorator/Log.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Decorator/Map.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Ldap.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Ldap.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Query/Ldap.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Result/Ldap.php
framework/Kolab_Server/package.xml
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Connection/SimpleldapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Connection/SplittedldapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Ldap/FilteredTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Ldap/StandardTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/LdapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Query/LdapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Result/LdapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Integration/MockTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Integration/PersonTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/LdapTestCase.php
framework/Kolab_Server/test/Horde/Kolab/Server/TestCase.php

index a9ac54b..f40a4c5 100644 (file)
@@ -31,14 +31,14 @@ implements Horde_Kolab_Server_Connection_Interface
     /**
      * The LDAP connection handle.
      *
-     * @var Net_LDAP2
+     * @var Horde_Ldap
      */
     private $_ldap;
 
     /**
      * Constructor
      *
-     * @param Net_LDAP2 $ldap The ldap connection.
+     * @param Horde_Ldap $ldap The ldap connection.
      */
     public function __construct(Horde_Kolab_Server_Connection_Mock_Ldap $ldap)
     {
index eb7d2eb..18b921e 100644 (file)
@@ -107,7 +107,7 @@ class Horde_Kolab_Server_Connection_Mock_Ldap
     * @param string $dn   DN of the entry that should be fetched
     * @param array  $attr Array of Attributes to select. If ommitted, all attributes are fetched.
     *
-    * @return Net_LDAP2_Entry|Net_LDAP2_Error    Reference to a Net_LDAP2_Entry object or Net_LDAP2_Error object
+    * @return Horde_Ldap_Entry|Horde_Ldap_Error    Reference to a Horde_Ldap_Entry object or Horde_Ldap_Error object
     * @todo Maybe check against the shema should be done to be sure the attribute type exists
     */
     public function getEntry($dn, $attr = array())
@@ -257,7 +257,7 @@ class Horde_Kolab_Server_Connection_Mock_Ldap
                     } else {
                         $result['att'] = $filter_parts[0];
                         $result['log'] = $filter_parts[1];
-                        $val = Net_LDAP2_Util::unescape_filter_value($filter_parts[2]);
+                        $val = Horde_Ldap_Util::unescape_filter_value($filter_parts[2]);
                         $result['val'] = $val[0];
                         return $result;
                     }
@@ -421,9 +421,9 @@ class Horde_Kolab_Server_Connection_Mock_Ldap
     /**
     * Add a new entryobject to a directory.
     *
-    * @param Net_LDAP2_Entry $entry Net_LDAP2_Entry
+    * @param Horde_Ldap_Entry $entry Horde_Ldap_Entry
     *
-    * @return Net_LDAP2_Error|true Net_LDAP2_Error object or true
+    * @return Horde_Ldap_Error|true Horde_Ldap_Error object or true
     */
     public function add($entry)
     {
@@ -443,11 +443,11 @@ class Horde_Kolab_Server_Connection_Mock_Ldap
     /**
     * Modify an ldapentry directly on the server
     *
-    * @param string|Net_LDAP2_Entry &$entry DN-string or Net_LDAP2_Entry
+    * @param string|Horde_Ldap_Entry &$entry DN-string or Horde_Ldap_Entry
     * @param array                 $parms  Array of changes
     *
     * @access public
-    * @return Net_LDAP2_Error|true Net_LDAP2_Error object or true
+    * @return Horde_Ldap_Error|true Horde_Ldap_Error object or true
     */
     public function modify($entry, $data = array())
     {
index b77e174..8c99031 100644 (file)
@@ -26,7 +26,7 @@
  * @link     http://pear.horde.org/index.php?package=Kolab_Server
  */
 class Horde_Kolab_Server_Connection_Mock_Search
-extends Net_LDAP2_Search
+extends Horde_Ldap_Search
 {
     /**
      * The search result.
index cd938f3..b5ccb92 100644 (file)
@@ -31,16 +31,16 @@ implements Horde_Kolab_Server_Connection_Interface
     /**
      * The LDAP connection handle.
      *
-     * @var Net_LDAP2
+     * @var Horde_Ldap
      */
     private $_ldap;
 
     /**
      * Constructor
      *
-     * @param Net_LDAP2 $ldap The ldap connection.
+     * @param Horde_Ldap $ldap The ldap connection.
      */
-    public function __construct(Net_LDAP2 $ldap)
+    public function __construct(Horde_Ldap $ldap)
     {
         $this->_ldap = $ldap;
     }
index 26506cc..65b70a2 100644 (file)
@@ -31,26 +31,26 @@ implements Horde_Kolab_Server_Connection_Interface
     /**
      * LDAP read connection handle.
      *
-     * @var Net_LDAP2
+     * @var Horde_Ldap
      */
     private $_ldap_read;
 
     /**
      * LDAP write connection handle.
      *
-     * @var Net_LDAP2
+     * @var Horde_Ldap
      */
     private $_ldap_write;
 
     /**
      * Constructor
      *
-     * @param Net_LDAP2 $ldap_read  The ldap_read connection.
-     * @param Net_LDAP2 $ldap_write The ldap_write connection.
+     * @param Horde_Ldap $ldap_read  The ldap_read connection.
+     * @param Horde_Ldap $ldap_write The ldap_write connection.
      */
     public function __construct(
-        Net_LDAP2 $ldap_read,
-        Net_LDAP2 $ldap_write
+        Horde_Ldap $ldap_read,
+        Horde_Ldap $ldap_write
     ) {
         $this->_ldap_read = $ldap_read;
         $this->_ldap_write = $ldap_write;
index 45144b4..0584f3a 100644 (file)
@@ -226,7 +226,7 @@ implements Horde_Kolab_Server_Interface
     /**
      * Return the ldap schema.
      *
-     * @return Net_LDAP2_Schema The LDAP schema.
+     * @return Horde_Ldap_Schema The LDAP schema.
      *
      * @throws Horde_Kolab_Server_Exception If retrieval of the schema failed.
      */
index ce252c7..a3d51f5 100644 (file)
@@ -259,7 +259,7 @@ implements Horde_Kolab_Server_Interface
     /**
      * Return the ldap schema.
      *
-     * @return Net_LDAP2_Schema The LDAP schema.
+     * @return Horde_Ldap_Schema The LDAP schema.
      *
      * @throws Horde_Kolab_Server_Exception If retrieval of the schema failed.
      */
index 2b8cda5..89a0549 100644 (file)
@@ -301,7 +301,7 @@ implements Horde_Kolab_Server_Interface
     /**
      * Return the ldap schema.
      *
-     * @return Net_LDAP2_Schema The LDAP schema.
+     * @return Horde_Ldap_Schema The LDAP schema.
      *
      * @throws Horde_Kolab_Server_Exception If retrieval of the schema failed.
      */
index e476163..55bb859 100644 (file)
@@ -256,7 +256,7 @@ implements Horde_Kolab_Server_Interface
     /**
      * Return the ldap schema.
      *
-     * @return Net_LDAP2_Schema The LDAP schema.
+     * @return Horde_Ldap_Schema The LDAP schema.
      *
      * @throws Horde_Kolab_Server_Exception If retrieval of the schema failed.
      */
index adb0045..3a241f3 100644 (file)
@@ -67,10 +67,10 @@ extends Horde_Kolab_Server_Factory_Connection_Base
     public function getConnection()
     {
         $configuration = $this->getConfiguration();
-        $ldap_read = new Net_LDAP2($configuration);
+        $ldap_read = new Horde_Ldap($configuration);
         if (isset($configuration['host_master'])) {
             $configuration['host'] = $configuration['host_master'];
-            $ldap_write = new Net_LDAP2($configuration);
+            $ldap_write = new Horde_Ldap($configuration);
             $connection = new Horde_Kolab_Server_Connection_Splittedldap(
                 $ldap_read, $ldap_write
             );
index 881c07c..c25fb3e 100644 (file)
@@ -66,7 +66,7 @@ implements Horde_Kolab_Server_Interface
         $this->_base_dn = $base_dn;
 
         $this->_handleError(
-            Net_LDAP2::checkLDAPExtension(),
+            Horde_Ldap::checkLDAPExtension(),
             Horde_Kolab_Server_Exception::MISSING_LDAP_EXTENSION
         );
     }
@@ -221,7 +221,7 @@ implements Horde_Kolab_Server_Interface
         Horde_Kolab_Server_Object_Interface $object,
         array $data
     ) {
-        $entry  = Net_LDAP2_Entry::createFresh($object->getGuid(), $data);
+        $entry  = Horde_Ldap_Entry::createFresh($object->getGuid(), $data);
         $this->_handleError($entry, Horde_Kolab_Server_Exception::SYSTEM);
         $this->_handleError(
             $this->_conn->getWrite()->add($entry),
@@ -267,7 +267,7 @@ implements Horde_Kolab_Server_Interface
     /**
      * Return the ldap schema.
      *
-     * @return Net_LDAP2_Schema The LDAP schema.
+     * @return Horde_Ldap_Schema The LDAP schema.
      *
      * @throws Horde_Kolab_Server_Exception If retrieval of the schema failed.
      */
@@ -287,7 +287,7 @@ implements Horde_Kolab_Server_Interface
      */
     public function getParentGuid($guid)
     {
-        $base = Net_LDAP2_Util::ldap_explode_dn(
+        $base = Horde_Ldap_Util::ldap_explode_dn(
             $guid,
             array(
                 'casefold' => 'none',
@@ -297,7 +297,7 @@ implements Horde_Kolab_Server_Interface
         );
         $this->_handleError($base);
         $id = array_shift($base);
-        $parent = Net_LDAP2_Util::canonical_dn(
+        $parent = Horde_Ldap_Util::canonical_dn(
             $base, array('casefold' => 'none')
         );
         $this->_handleError($parent);
index 846c9e5..516c15a 100644 (file)
@@ -185,7 +185,7 @@ implements Horde_Kolab_Server_Query_Interface
         Horde_Kolab_Server_Query_Element_Single $single,
         $operator
     ) {
-        $result = Net_LDAP2_Filter::create(
+        $result = Horde_Ldap_Filter::create(
             $this->_structure->mapExternalToInternalAttribute(
                 $single->getName()
             ),
@@ -208,7 +208,7 @@ implements Horde_Kolab_Server_Query_Interface
     public function convertNot(Horde_Kolab_Server_Query_Element_Not $not)
     {
         $elements = $not->getElements();
-        $result = Net_LDAP2_Filter::combine('!', $elements[0]->convert($this));
+        $result = Horde_Ldap_Filter::combine('!', $elements[0]->convert($this));
         $this->_handleError($result);
         return $result;
     }
@@ -259,7 +259,7 @@ implements Horde_Kolab_Server_Query_Interface
         foreach ($group->getElements() as $element) {
             $filters[] = $element->convert($this);
         }
-        $result = Net_LDAP2_Filter::combine($operator, $filters);
+        $result = Horde_Ldap_Filter::combine($operator, $filters);
         $this->_handleError($result);
         return $result;
     }
index f2aee7a..89af79a 100644 (file)
@@ -31,16 +31,16 @@ implements Horde_Kolab_Server_Result_Interface
     /**
      * The search result.
      *
-     * @var Net_LDAP2_Search
+     * @var Horde_Ldap_Search
      */
     private $_search;
 
     /**
      * Constructor.
      *
-     * @param Net_LDAP2_Search $search The LDAP search result.
+     * @param Horde_Ldap_Search $search The LDAP search result.
      */
-    public function __construct(Net_LDAP2_Search $search)
+    public function __construct(Horde_Ldap_Search $search)
     {
         $this->_search = $search;
     }
index 65cc45e..92e1b1a 100644 (file)
@@ -345,8 +345,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
     <channel>pear.horde.org</channel>
    </package>
    <package>
-    <name>Net_LDAP2</name>
-    <channel>pear.php.net</channel>
+    <name>Horde_Ldap</name>
+    <channel>pear.horde.org</channel>
    </package>
    <extension>
     <name>ldap</name>
index aaa12c9..bda0656 100644 (file)
@@ -35,27 +35,27 @@ extends Horde_Kolab_Server_LdapTestCase
 {
     public function testMethodConstructHasParameterNetldap2Connection()
     {
-        $ldap = $this->getMock('Net_LDAP2');
+        $ldap = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
     }
 
     public function testMethodConstructHasPostconditionThatTheGivenServerWasStored()
     {
-        $ldap = $this->getMock('Net_LDAP2');
+        $ldap = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
         $this->assertSame($ldap, $conn->getRead());
     }
 
     public function testMethodGetreadHasResultNetldap2TheHandledConnection()
     {
-        $ldap = $this->getMock('Net_LDAP2');
+        $ldap = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
-        $this->assertType('Net_LDAP2', $conn->getRead());
+        $this->assertType('Horde_Ldap', $conn->getRead());
     }
 
     public function testMethodGetwriteHasResultNetldap2TheHandledConnection()
     {
-        $ldap = $this->getMock('Net_LDAP2');
+        $ldap = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
         $this->assertSame($conn->getWrite(), $conn->getRead());
     }
index 3d845ca..a001562 100644 (file)
@@ -35,15 +35,15 @@ extends Horde_Kolab_Server_LdapTestCase
 {
     public function testMethodConstructHasParameterNetldap2ReadConnectionAndParameterNetldap2WriteConnection()
     {
-        $ldap_read = $this->getMock('Net_LDAP2');
-        $ldap_write = $this->getMock('Net_LDAP2');
+        $ldap_read = $this->getMock('Horde_Ldap');
+        $ldap_write = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Splittedldap($ldap_read, $ldap_write);
     }
 
     public function testMethodConstructHasPostconditionThatTheGivenServersWereStored()
     {
-        $ldap_read = $this->getMock('Net_LDAP2');
-        $ldap_write = $this->getMock('Net_LDAP2');
+        $ldap_read = $this->getMock('Horde_Ldap');
+        $ldap_write = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Splittedldap($ldap_read, $ldap_write);
         $this->assertSame($ldap_read, $conn->getRead());
         $this->assertSame($ldap_write, $conn->getWrite());
@@ -51,17 +51,17 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetreadHasResultNetldap2TheHandledConnection()
     {
-        $ldap_read = $this->getMock('Net_LDAP2');
-        $ldap_write = $this->getMock('Net_LDAP2');
+        $ldap_read = $this->getMock('Horde_Ldap');
+        $ldap_write = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Splittedldap($ldap_read, $ldap_write);
-        $this->assertType('Net_LDAP2', $conn->getRead());
-        $this->assertType('Net_LDAP2', $conn->getWrite());
+        $this->assertType('Horde_Ldap', $conn->getRead());
+        $this->assertType('Horde_Ldap', $conn->getWrite());
     }
 
     public function testMethodGetwriteHasResultNetldap2TheHandledConnection()
     {
-        $ldap_read = $this->getMock('Net_LDAP2');
-        $ldap_write = $this->getMock('Net_LDAP2');
+        $ldap_read = $this->getMock('Horde_Ldap');
+        $ldap_write = $this->getMock('Horde_Ldap');
         $conn = new Horde_Kolab_Server_Connection_Splittedldap($ldap_read, $ldap_write);
         $this->assertFalse($conn->getWrite() === $conn->getRead());
     }
index 3070478..c22f84f 100644 (file)
@@ -36,8 +36,8 @@ class Horde_Kolab_Server_Class_Server_Ldap_FilteredTest extends Horde_Kolab_Serv
     {
         $this->skipIfNoLdap();
 
-        $this->ldap_read  = $this->getMock('Net_LDAP2');
-        $this->ldap_write = $this->getMock('Net_LDAP2');
+        $this->ldap_read  = $this->getMock('Horde_Ldap');
+        $this->ldap_write = $this->getMock('Horde_Ldap');
         $connection = new Horde_Kolab_Server_Connection_Splittedldap(
             $this->ldap_read,
             $this->ldap_write
@@ -53,7 +53,7 @@ class Horde_Kolab_Server_Class_Server_Ldap_FilteredTest extends Horde_Kolab_Serv
     private function getSearchResultMock()
     {
         $result = $this->getMock(
-            'Net_LDAP2_Search', array('as_struct', 'count'), array(), '', false
+            'Horde_Ldap_Search', array('as_struct', 'count'), array(), '', false
         );
         $result->expects($this->any())
             ->method('as_struct')
index 01d367b..fab3e27 100644 (file)
@@ -36,8 +36,8 @@ class Horde_Kolab_Server_Class_Server_Ldap_StandardTest extends Horde_Kolab_Serv
     {
         $this->skipIfNoLdap();
 
-        $this->ldap_read  = $this->getMock('Net_LDAP2');
-        $this->ldap_write = $this->getMock('Net_LDAP2');
+        $this->ldap_read  = $this->getMock('Horde_Ldap');
+        $this->ldap_write = $this->getMock('Horde_Ldap');
         $connection = new Horde_Kolab_Server_Connection_Splittedldap(
             $this->ldap_read,
             $this->ldap_write
@@ -52,7 +52,7 @@ class Horde_Kolab_Server_Class_Server_Ldap_StandardTest extends Horde_Kolab_Serv
     private function getSearchResultMock()
     {
         $result = $this->getMock(
-            'Net_LDAP2_Search', array('as_struct', 'count'), array(), '', false
+            'Horde_Ldap_Search', array('as_struct', 'count'), array(), '', false
         );
         $result->expects($this->any())
             ->method('as_struct')
index 5537d0b..585b953 100644 (file)
@@ -36,8 +36,8 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
     {
         $this->skipIfNoLdap();
 
-        $this->ldap_read  = $this->getMock('Net_LDAP2');
-        $this->ldap_write = $this->getMock('Net_LDAP2');
+        $this->ldap_read  = $this->getMock('Horde_Ldap');
+        $this->ldap_write = $this->getMock('Horde_Ldap');
         $connection = new Horde_Kolab_Server_Connection_Splittedldap(
             $this->ldap_read,
             $this->ldap_write
@@ -52,7 +52,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
     private function getSearchResultMock()
     {
         $result = $this->getMock(
-            'Net_LDAP2_Search', array('as_struct', 'count'), array(), '', false
+            'Horde_Ldap_Search', array('as_struct', 'count'), array(), '', false
         );
         $result->expects($this->any())
             ->method('as_struct')
@@ -164,7 +164,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
     public function testMethodReadThrowsExceptionIfTheObjectWasNotFound()
     {
         $result = $this->getMock(
-            'Net_LDAP2_Search', array('as_struct', 'count'), array(), '', false
+            'Horde_Ldap_Search', array('as_struct', 'count'), array(), '', false
         );
         $result->expects($this->exactly(1))
             ->method('count')
@@ -211,7 +211,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
     public function testMethodReadAttributesThrowsExceptionIfTheObjectWasNotFound()
     {
         $result = $this->getMock(
-            'Net_LDAP2_Search', array('as_struct', 'count'), array(), '', false
+            'Horde_Ldap_Search', array('as_struct', 'count'), array(), '', false
         );
         $result->expects($this->exactly(1))
             ->method('count')
@@ -276,7 +276,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
     public function testMethodSaveHasParameterObjectTheObjectToModifyOnTheServer()
     {
         $entry = $this->getMock(
-            'Net_LDAP2_Entry', array(), array(), '', false
+            'Horde_Ldap_Entry', array(), array(), '', false
         );
         $object = $this->getMock('Horde_Kolab_Server_Object_Interface');
         $this->ldap_write->expects($this->exactly(1))
@@ -284,7 +284,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
             ->will($this->returnValue($entry));
         $this->ldap_write->expects($this->exactly(1))
             ->method('modify')
-            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Net_LDAP2_Entry'));
+            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Horde_Ldap_Entry'));
         $object->expects($this->exactly(1))
             ->method('readInternal')
             ->will($this->returnValue(array()));
@@ -294,7 +294,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
     public function testMethodSaveHasParameterArrayData()
     {
         $entry = $this->getMock(
-            'Net_LDAP2_Entry', array(), array(), '', false
+            'Horde_Ldap_Entry', array(), array(), '', false
         );
         $object = $this->getMock('Horde_Kolab_Server_Object_Interface');
         $this->ldap_write->expects($this->exactly(1))
@@ -302,7 +302,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
             ->will($this->returnValue($entry));
         $this->ldap_write->expects($this->exactly(1))
             ->method('modify')
-            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Net_LDAP2_Entry'));
+            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Horde_Ldap_Entry'));
         $object->expects($this->exactly(1))
             ->method('readInternal')
             ->will($this->returnValue(array()));
@@ -312,7 +312,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
     public function testMethodSaveHasPostconditionThatTheEntryWasModified()
     {
         $entry = $this->getMock(
-            'Net_LDAP2_Entry', array(), array(), '', false
+            'Horde_Ldap_Entry', array(), array(), '', false
         );
         $object = $this->getMock('Horde_Kolab_Server_Object_Interface');
         $this->ldap_write->expects($this->exactly(1))
@@ -320,7 +320,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
             ->will($this->returnValue($entry));
         $this->ldap_write->expects($this->exactly(1))
             ->method('modify')
-            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Net_LDAP2_Entry'));
+            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Horde_Ldap_Entry'));
         $object->expects($this->exactly(1))
             ->method('readInternal')
             ->will($this->returnValue(array()));
@@ -350,7 +350,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
         $object = $this->getMock('Horde_Kolab_Server_Object_Interface');
         $this->ldap_write->expects($this->exactly(1))
             ->method('add')
-            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Net_LDAP2_Entry'));
+            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Horde_Ldap_Entry'));
         $this->server->add($object, array('attributes' => array('dn')));
     }
 
@@ -359,7 +359,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
         $object = $this->getMock('Horde_Kolab_Server_Object_Interface');
         $this->ldap_write->expects($this->exactly(1))
             ->method('add')
-            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Net_LDAP2_Entry'));
+            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Horde_Ldap_Entry'));
         $this->server->add($object, array('dn' => 'test'));
     }
 
@@ -368,7 +368,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
         $object = $this->getMock('Horde_Kolab_Server_Object_Interface');
         $this->ldap_write->expects($this->exactly(1))
             ->method('add')
-            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Net_LDAP2_Entry'));
+            ->with(new PHPUnit_Framework_Constraint_IsInstanceOf('Horde_Ldap_Entry'));
         $this->server->add($object, array('dn' => 'test'));
     }
 
@@ -489,7 +489,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
 
 /*     public function testMethodSearchReturnsArrayMappedSearchResultIfMappingIsActivated() */
 /*     { */
-/*         $ldap = $this->getMock('Net_LDAP2', array('search')); */
+/*         $ldap = $this->getMock('Horde_Ldap', array('search')); */
 /*         $ldap->expects($this->exactly(1)) */
 /*             ->method('search') */
 /*             ->will($this->returnValue(new Search_Mock(array(array('dn2' => 'test'))))); */
index 7e3b5e6..04e6a16 100644 (file)
@@ -215,18 +215,11 @@ class Horde_Kolab_Server_Class_Server_Query_LdapTest extends Horde_Kolab_Server_
         $or = new Horde_Kolab_Server_Query_Element_Or(array($equals));
         $query = new Horde_Kolab_Server_Query_Ldap($or, $this->structure);
 
-        /** Hide strict errors from the Net_LDAP2 library */
-        $error_reporting = error_reporting();
-        error_reporting($error_reporting & ~E_STRICT);
-
         try {
             $query->convertOr($or)->asString();
             $this->fail('No exception!');
         } catch (Horde_Kolab_Server_Exception $e) {
             $this->assertEquals(Horde_Kolab_Server_Exception::INVALID_QUERY, $e->getCode());
         }
-
-        /** Reactivate original error reporting */
-        error_reporting($error_reporting);
     }
 }
index adccba7..78dabec 100644 (file)
@@ -35,7 +35,7 @@ class Horde_Kolab_Server_Class_Server_Result_LdapTest extends Horde_Kolab_Server
     public function testMethodConstructHasParameterNetldap2searchSearchResult()
     {
         $search = $this->getMock(
-            'Net_LDAP2_Search', array(), array(), '', false
+            'Horde_Ldap_Search', array(), array(), '', false
         );
         $result = new Horde_Kolab_Server_Result_Ldap($search);
     }
@@ -44,7 +44,7 @@ class Horde_Kolab_Server_Class_Server_Result_LdapTest extends Horde_Kolab_Server
     public function testMethodCountHasResultIntTheNumberOfElementsFound()
     {
         $search = $this->getMock(
-            'Net_LDAP2_Search', array('count'), array(), '', false
+            'Horde_Ldap_Search', array('count'), array(), '', false
         );
         $search->expects($this->exactly(1))
             ->method('count')
@@ -56,7 +56,7 @@ class Horde_Kolab_Server_Class_Server_Result_LdapTest extends Horde_Kolab_Server
     public function testMethodSizelimitexceededHasResultBooleanIndicatingIfTheSearchSizeLimitWasHit()
     {
         $search = $this->getMock(
-            'Net_LDAP2_Search', array('sizeLimitExceeded'), array(), '', false
+            'Horde_Ldap_Search', array('sizeLimitExceeded'), array(), '', false
         );
         $search->expects($this->exactly(1))
             ->method('sizeLimitExceeded')
@@ -68,7 +68,7 @@ class Horde_Kolab_Server_Class_Server_Result_LdapTest extends Horde_Kolab_Server
     public function testMethodAsarrayHasResultArrayWithTheSearchResults()
     {
         $search = $this->getMock(
-            'Net_LDAP2_Search', array('as_struct'), array(), '', false
+            'Horde_Ldap_Search', array('as_struct'), array(), '', false
         );
         $search->expects($this->exactly(1))
             ->method('as_struct')
index b004ad6..992d711 100644 (file)
@@ -85,17 +85,10 @@ class Horde_Kolab_Server_Integration_MockTest extends Horde_Kolab_Server_Integra
             $this->markTestSuiteSkipped('Ldap extension is missing!');
         };
 
-        /** Hide strict errors from the Net_LDAP2 library */
-        $error_reporting = error_reporting();
-        error_reporting($error_reporting & ~E_STRICT);
-
-        if (!class_exists('Net_LDAP2')) {
-            $this->markTestSuiteSkipped('PEAR package Net_LDAP2 is not installed!');
+        if (!class_exists('Horde_Ldap')) {
+            $this->markTestSuiteSkipped('PEAR package Horde_Ldap is not installed!');
         }
 
-        /** Reactivate original error reporting */
-        error_reporting($error_reporting);
-
         $this->markTestIncomplete('Needs to be fixed');
 
         $this->initializeEnvironments();
@@ -396,7 +389,7 @@ class Horde_Kolab_Server_Integration_MockTest extends Horde_Kolab_Server_Integra
     {
         foreach ($this->servers as $server) {
             $filter = '(&(objectClass=kolabGroupOfNames)(member='
-                . Net_LDAP2_Util::escape_filter_value('cn=The Administrator,dc=example,dc=org') . '))';
+                . Horde_Ldap_Util::escape_filter_value('cn=The Administrator,dc=example,dc=org') . '))';
             $result = $server->search($filter, array());
             $this->assertTrue(!empty($result));
 
index 0b557e5..3a92d9f 100644 (file)
@@ -160,8 +160,8 @@ class Horde_Kolab_Server_Integration_PersonTest extends Horde_Kolab_Server_Integ
                 $this->assertNoError($result);
                 $cn_result = $server->uidForCn($this->objects[$add]['Cn']);
                 $this->assertNoError($cn_result);
-                $dn_parts = Net_LDAP2_Util::ldap_explode_dn($cn_result, array('casefold' => 'lower'));
-                $dnpart = Net_LDAP2_Util::unescape_dn_value($dn_parts[0]);
+                $dn_parts = Horde_Ldap_Util::ldap_explode_dn($cn_result, array('casefold' => 'lower'));
+                $dnpart = Horde_Ldap_Util::unescape_dn_value($dn_parts[0]);
                 /**
                  * @todo: I currently do not really understand why the forward slash
                  * is not correctly converted back but I lack the time to analyse it
@@ -238,8 +238,8 @@ class Horde_Kolab_Server_Integration_PersonTest extends Horde_Kolab_Server_Integ
 
             $cn_result = $server->uidForCn($this->objects[5]['Cn'][0]);
             $this->assertNoError($cn_result);
-            $dn_parts = Net_LDAP2_Util::ldap_explode_dn($cn_result, array('casefold' => 'lower'));
-            $dnpart = Net_LDAP2_Util::unescape_dn_value($dn_parts[0]);
+            $dn_parts = Horde_Ldap_Util::ldap_explode_dn($cn_result, array('casefold' => 'lower'));
+            $dnpart = Horde_Ldap_Util::unescape_dn_value($dn_parts[0]);
             $this->assertContains('Cn' . '=' . $this->objects[5]['Cn'][0],
                                   $dnpart[0]);
         }
index ff81ed4..ee90db8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Skip LDAP based tests if we don't have ldap or Net_LDAP2.
+ * Skip LDAP based tests if we don't have ldap or Horde_Ldap.
  *
  * PHP version 5
  *
@@ -17,7 +17,7 @@
 require_once dirname(__FILE__) . '/TestCase.php';
 
 /**
- * Skip LDAP based tests if we don't have ldap or Net_LDAP2.
+ * Skip LDAP based tests if we don't have ldap or Horde_Ldap.
  *
  * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
  *
@@ -35,18 +35,11 @@ class Horde_Kolab_Server_LdapTestCase extends Horde_Kolab_Server_TestCase
     public function skipIfNoLdap()
     {
         if (!extension_loaded('ldap') && !@dl('ldap.' . PHP_SHLIB_SUFFIX)) {
-            $this->markTestSuiteSkipped('Ldap extension is missing!');
+            $this->markTestSkipped('Ldap extension is missing!');
         };
 
-        /** Hide strict errors from the Net_LDAP2 library */
-        $error_reporting = error_reporting();
-        error_reporting($error_reporting & ~E_STRICT);
-
-        if (!class_exists('Net_LDAP2')) {
-            $this->markTestSkipped('PEAR package Net_LDAP2 is not installed!');
+        if (!class_exists('Horde_Ldap')) {
+            $this->markTestSkipped('Horde_Ldap is not installed!');
         }
-
-        /** Reactivate original error reporting */
-        error_reporting($error_reporting);
     }
 }
\ No newline at end of file
index 0843e9e..0ab0c49 100644 (file)
@@ -24,7 +24,7 @@ require_once dirname(__FILE__) . '/Constraints/Searchcn.php';
 require_once dirname(__FILE__) . '/Constraints/Searchalias.php';
 
 /**
- * Skip LDAP based tests if we don't have ldap or Net_LDAP2.
+ * Provides functions required by several Kolab_Server tests.
  *
  * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
  *