summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-02-21 09:23:02 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-02-21 09:23:02 (GMT)
commit474486a544b779462ddf17c517569b3ae048f45b (patch)
treee76973007d43884e333238f3d984e1112a1607f9 /test
parent40220098e4d180d284378259c23e9d91a771273b (diff)
downloadkolab-webadmin-474486a544b779462ddf17c517569b3ae048f45b.tar.gz
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.
Diffstat (limited to 'test')
-rw-r--r--test/KolabAdmin/Unit/BaseTest.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/KolabAdmin/Unit/BaseTest.php b/test/KolabAdmin/Unit/BaseTest.php
index b91eaed..55e7f9b 100644
--- a/test/KolabAdmin/Unit/BaseTest.php
+++ b/test/KolabAdmin/Unit/BaseTest.php
@@ -76,6 +76,18 @@ class KolabAdmin_Unit_BaseTest extends PHPUnit_Framework_TestCase
);
}
+ 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 @@ class KolabAdmin_Unit_BaseTest extends PHPUnit_Framework_TestCase
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,