Annotation of embedaddon/php/ext/ldap/tests/ldap_parse_result_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_parse_result() - Basic ldap_parse_result 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: ldap_add($link, "cn=userref,dc=my-domain,dc=com", array(
! 16: "objectClass" => array("extensibleObject", "referral"),
! 17: "cn" => "userref",
! 18: "ref" => "cn=userA,dc=my-domain,dc=com",
! 19: ));
! 20: $result = ldap_search($link, "cn=userref,dc=my-domain,dc=com", "(cn=user*)");
! 21: $errcode = $dn = $errmsg = $refs = null;
! 22: var_dump(
! 23: ldap_parse_result($link, $result, $errcode, $dn, $errmsg, $refs),
! 24: $errcode, $dn, $errmsg, $refs
! 25: );
! 26: ?>
! 27: ===DONE===
! 28: --CLEAN--
! 29: <?php
! 30: include "connect.inc";
! 31:
! 32: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 33: // Referral can only be removed with Manage DSA IT Control
! 34: ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, array(array("oid" => "2.16.840.1.113730.3.4.2")));
! 35: ldap_delete($link, "cn=userref,dc=my-domain,dc=com");
! 36: remove_dummy_data($link);
! 37: ?>
! 38: --EXPECT--
! 39: bool(true)
! 40: int(10)
! 41: string(30) "cn=userref,dc=my-domain,dc=com"
! 42: string(0) ""
! 43: array(1) {
! 44: [0]=>
! 45: string(28) "cn=userA,dc=my-domain,dc=com"
! 46: }
! 47: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>