Annotation of embedaddon/php/ext/ldap/tests/ldap_unbind_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_unbind() - ldap_unbind() operations 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_and_bind($host, $port, $user, $passwd, $protocol_version);
! 14:
! 15: // Too few parameters
! 16: var_dump(ldap_unbind());
! 17:
! 18: // Too many parameters
! 19: var_dump(ldap_unbind($link, "Additional data"));
! 20:
! 21: // Bad parameter
! 22: var_dump(ldap_unbind("string"));
! 23:
! 24: // unbind twice
! 25: var_dump(ldap_unbind($link));
! 26: var_dump(ldap_unbind($link));
! 27: ?>
! 28: ===DONE===
! 29: --EXPECTF--
! 30: Warning: ldap_unbind() expects exactly 1 parameter, 0 given in %s on line %d
! 31: bool(false)
! 32:
! 33: Warning: ldap_unbind() expects exactly 1 parameter, 2 given in %s on line %d
! 34: bool(false)
! 35:
! 36: Warning: ldap_unbind() expects parameter 1 to be resource, %unicode_string_optional% given in %s on line %d
! 37: bool(false)
! 38: bool(true)
! 39:
! 40: Warning: ldap_unbind(): %d is not a valid ldap link resource in %s on line %d
! 41: bool(false)
! 42: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>