Permalink
Browse files

added rename test

git-svn-id: http://svn.php.net/repository/pear/packages/Net_LDAP/trunk@145014 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 09a2890 commit ee08f54b98dd780c928f1189dbd0ef59087cbe3b Jan Wagner committed Nov 28, 2003
Showing with 22 additions and 0 deletions.
  1. +19 −0 tests/PHPUnit/Net_LDAP.php
  2. +3 −0 tests/PHPUnit/config.php
View
@@ -95,6 +95,25 @@ function testSearch2()
$this->assertTrue(is_string($value) && $value != '', 'Attribute value was not a string or empty');
}
}
+
+ function testRename()
+ {
+ if ($this->assertTrue(isset($GLOBALS['existing_dn']), 'exisiting dn not set in config')) {
+ return false;
+ }
+ if ($this->assertTrue(isset($GLOBALS['rename_dn']), 'rename dn not set in config')) {
+ return false;
+ }
+
+ $entry = $this->ldap->getEntry($GLOBALS['existing_dn']);
+ $this->assertEquals('net_ldap_entry', get_class($entry));
+
+ foreach (array($GLOBALS['rename_dn'], $GLOBALS['existing_dn']) as $dn) {
+ $entry->dn($dn);
+ $msg = $entry->update();
+ $this->assertFalse(Net_LDAP::isError($msg), 'Could not rename entry');
+ }
+ }
}
?>
View
@@ -4,10 +4,13 @@
$ldap_config= array('host' => '192.168.123.253',
'version' => 3,
'base' => 'o=netsols,c=de',
+ 'dn' => 'cn=admin,o=netsols,c=de',
+ 'password' => '******',
'filter' => '(objectClass=*)');
// this should be an existing dn which can be fetched with the above connection parameters
$existing_dn = 'uid=wagner,ou=mailAccounts,cn=netsols.de,ou=Domains,o=netsols,c=de';
+$rename_dn = 'uid=wagner2,ou=mailAccounts,cn=netsols.de,ou=Domains,o=netsols,c=de';
// these should be parameters for an ldap query that returns at least one entry with one attribute
$search2 = array('filter' => '(&(objectClass=domainRelatedObject)(domainStatus=active))',

0 comments on commit ee08f54

Please sign in to comment.