Annotation of embedaddon/php/ext/ldap/tests/ldap_rename_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_rename() - Basic ldap_rename test
! 3: --CREDITS--
! 4: Patrick Allaert <patrickallaert@php.net>
! 5: # Belgian PHP Testfest 2009
! 6: --SKIPIF--
! 7: <?php require_once('skipif.inc'); ?>
! 8: <?php require_once('skipifbindfailure.inc'); ?>
! 9: --FILE--
! 10: <?php
! 11: require "connect.inc";
! 12:
! 13: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 14: insert_dummy_data($link);
! 15: var_dump(
! 16: ldap_rename($link, "cn=userA,dc=my-domain,dc=com", "cn=userZ", "dc=my-domain,dc=com", true)
! 17: );
! 18: $result = ldap_search($link, "dc=my-domain,dc=com", "(cn=userA)", array("cn", "sn"));
! 19: $result = ldap_search($link, "dc=my-domain,dc=com", "(cn=userZ)", array("cn", "sn"));
! 20: var_dump(ldap_get_entries($link, $result));
! 21: ?>
! 22: ===DONE===
! 23: --CLEAN--
! 24: <?php
! 25: include "connect.inc";
! 26:
! 27: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 28: ldap_rename($link, "cn=userZ,dc=my-domain,dc=com", "cn=userA", "dc=my-domain,dc=com", true);
! 29: remove_dummy_data($link);
! 30: ?>
! 31: --EXPECT--
! 32: bool(true)
! 33: array(2) {
! 34: ["count"]=>
! 35: int(1)
! 36: [0]=>
! 37: array(6) {
! 38: ["sn"]=>
! 39: array(2) {
! 40: ["count"]=>
! 41: int(1)
! 42: [0]=>
! 43: string(7) "testSN1"
! 44: }
! 45: [0]=>
! 46: string(2) "sn"
! 47: ["cn"]=>
! 48: array(2) {
! 49: ["count"]=>
! 50: int(1)
! 51: [0]=>
! 52: string(5) "userZ"
! 53: }
! 54: [1]=>
! 55: string(2) "cn"
! 56: ["count"]=>
! 57: int(2)
! 58: ["dn"]=>
! 59: string(28) "cn=userZ,dc=my-domain,dc=com"
! 60: }
! 61: }
! 62: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>