gunnar: server/kolab-webadmin/kolab-webadmin/test/KolabAdmin/Unit BaseTest.php, 1.5, 1.6

cvs at kolab.org cvs at kolab.org
Sun Feb 21 10:23:04 CET 2010


Author: gunnar

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/test/KolabAdmin/Unit
In directory doto:/tmp/cvs-serv4748/kolab-webadmin/test/KolabAdmin/Unit

Modified Files:
	BaseTest.php 
Log Message:
Add testing for countMail when adding users with escaped dn values. Manual testing of the application also looks good. Consider kolab/issue3499 (Kolab web admin does not use LDAP escaping) fixed.

Index: BaseTest.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/test/KolabAdmin/Unit/BaseTest.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- BaseTest.php	21 Feb 2010 09:08:52 -0000	1.5
+++ BaseTest.php	21 Feb 2010 09:23:02 -0000	1.6
@@ -76,6 +76,18 @@
         );
     }
 
+    public function testCountmailReturnsOneOnExistingMailWithEscapedDnCharacters()
+    {
+        $this->_add($this->_getTestUser(',=,'));
+        $this->assertEquals(
+            1,
+            $this->ldap->countMail(
+                $_SESSION['base_dn'],
+                'kolabadmin.test.,=,@' . $_SESSION['fqdnhostname']
+            )
+        );
+    }
+
     public function testAddingObjectIsSuccessful()
     {
         $this->_add($this->_getTestUser());
@@ -92,15 +104,16 @@
 
     private function _getTestUser($id = null)
     {
+        $cn = 'KolabAdmin TestUser' . $id;
         return array(
-            'dn' => 'cn=KolabAdmin TestUser' . $id . ',' . $_SESSION['base_dn'],
+            'dn' => 'cn=' . $this->ldap->dn_escape($cn) . ',' . $_SESSION['base_dn'],
             'attributes' => array(
                 'objectClass'  => array(
                     'top', 'inetOrgPerson', 'kolabInetOrgPerson'
                 ),
                 'userPassword' => 'test',
                 'sn'           => 'TestUser' . $id,
-                'cn'           => 'KolabAdmin TestUser' . $id,
+                'cn'           => $cn,
                 'givenName'    => 'KolabAdmin',
                 'mail'         => 'kolabadmin.test.' . $id . '@' . $_SESSION['fqdnhostname'],
                 'uid'          => 'kolabadmin.test.' . $id,





More information about the commits mailing list