Annotation of embedaddon/php/ext/ldap/tests/ldap_set_rebind_proc_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_set_rebind_proc() - Testing ldap_set_rebind_proc() that should fail
! 3: --CREDITS--
! 4: Patrick Allaert <patrickallaert@php.net>
! 5: # Belgian PHP Testfest 2009
! 6: --SKIPIF--
! 7: <?php require_once('skipif.inc'); ?>
! 8: --FILE--
! 9: <?php
! 10: require "connect.inc";
! 11:
! 12: function rebind_proc ($ds, $ldap_url) {
! 13: global $user;
! 14: global $passwd;
! 15: global $protocol_version;
! 16:
! 17: // required by most modern LDAP servers, use LDAPv3
! 18: ldap_set_option($a, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
! 19:
! 20: if (!ldap_bind($a, $user, $passwd)) {
! 21: print "Cannot bind";
! 22: }
! 23: }
! 24:
! 25: $link = ldap_connect($host, $port);
! 26: var_dump(ldap_set_rebind_proc($link));
! 27: var_dump(ldap_set_rebind_proc($link, "rebind_proc", "Additional data"));
! 28: var_dump(ldap_set_rebind_proc($link, "rebind_proc_inexistant"));
! 29: ?>
! 30: ===DONE===
! 31: --EXPECTF--
! 32: Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 1 given in %s on line %d
! 33: bool(false)
! 34:
! 35: Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 3 given in %s on line %d
! 36: bool(false)
! 37:
! 38: Warning: ldap_set_rebind_proc(): Two arguments expected for 'rebind_proc_inexistant' to be a valid callback in %s on line %d
! 39: bool(false)
! 40: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>