1--TEST--
2ldap_unbind() - ldap_unbind() operations that should fail
3--CREDITS--
4Patrick 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
11require "connect.inc";
12
13$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
14
15// Too few parameters
16var_dump(ldap_unbind());
17
18// Too many parameters
19var_dump(ldap_unbind($link, "Additional data"));
20
21// Bad parameter
22var_dump(ldap_unbind("string"));
23
24// unbind twice
25var_dump(ldap_unbind($link));
26var_dump(ldap_unbind($link));
27?>
28===DONE===
29--EXPECTF--
30Warning: ldap_unbind() expects exactly 1 parameter, 0 given in %s on line %d
31bool(false)
32
33Warning: ldap_unbind() expects exactly 1 parameter, 2 given in %s on line %d
34bool(false)
35
36Warning: ldap_unbind() expects parameter 1 to be resource, %unicode_string_optional% given in %s on line %d
37bool(false)
38bool(true)
39
40Warning: ldap_unbind(): %d is not a valid ldap link resource in %s on line %d
41bool(false)
42===DONE===
43