diff options
author | Gunnar Wrobel <wrobel@pardus.de> | 2010-02-21 09:23:02 (GMT) |
---|---|---|
committer | Gunnar Wrobel <wrobel@pardus.de> | 2010-02-21 09:23:02 (GMT) |
commit | 474486a544b779462ddf17c517569b3ae048f45b (patch) | |
tree | e76973007d43884e333238f3d984e1112a1607f9 | |
parent | 40220098e4d180d284378259c23e9d91a771273b (diff) | |
download | kolab-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.
-rw-r--r-- | test/KolabAdmin/Unit/BaseTest.php | 17 |
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, |