Annotation of embedaddon/php/ext/ldap/tests/ldap_bind_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_bind() - Binding 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: <?php require_once('skipifbindfailure.inc'); ?>
! 9: --FILE--
! 10: <?php
! 11: require "connect.inc";
! 12:
! 13: $link = ldap_connect($host, $port);
! 14: ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
! 15:
! 16: // Invalid parameter count
! 17: var_dump(ldap_bind($link, $user, $passwd, null));
! 18:
! 19: // Invalid password
! 20: var_dump(ldap_bind($link, $user, "ThisIsNotCorrect$passwd"));
! 21:
! 22: // Invalid DN syntax
! 23: var_dump(ldap_bind($link, "unexistingProperty=weirdValue,$user", $passwd));
! 24: ?>
! 25: ===DONE===
! 26: --EXPECTF--
! 27: Warning: ldap_bind() expects at most 3 parameters, 4 given in %s on line %d
! 28: bool(false)
! 29:
! 30: Warning: ldap_bind(): Unable to bind to server: Invalid credentials in %s on line %d
! 31: bool(false)
! 32:
! 33: Warning: ldap_bind(): Unable to bind to server: Invalid DN syntax in %s on line %d
! 34: bool(false)
! 35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>