1--TEST--
2ldap_get_option() - More ldap_get_option() operations
3--CREDITS--
4Patrick Allaert <patrickallaert@php.net>
5# Belgian PHP Testfest 2009
6--SKIPIF--
7<?php require_once('skipif.inc'); ?>
8--FILE--
9<?php
10require "connect.inc";
11
12$link = ldap_connect($host, $port);
13$option = null;
14
15$controls = array(
16	array("oid" => "1.2.752.58.10.1", "iscritical" => true),
17	array("oid" => "1.2.752.58.1.10", "value" => "magic"),
18);
19
20ldap_set_option($link, LDAP_OPT_DEREF, LDAP_DEREF_NEVER);
21ldap_set_option($link, LDAP_OPT_SIZELIMIT, 123);
22ldap_set_option($link, LDAP_OPT_TIMELIMIT, 33);
23ldap_set_option($link, LDAP_OPT_NETWORK_TIMEOUT, 44);
24ldap_set_option($link, LDAP_OPT_TIMEOUT, 55);
25ldap_set_option($link, LDAP_OPT_REFERRALS, false);
26ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, $controls);
27ldap_set_option($link, LDAP_OPT_CLIENT_CONTROLS, $controls);
28ldap_set_option($link, LDAP_OPT_RESTART, false);
29
30var_dump(
31	ldap_get_option($link, LDAP_OPT_DEREF, $option),
32	$option,
33	ldap_get_option($link, LDAP_OPT_SIZELIMIT, $option),
34	$option,
35	ldap_get_option($link, LDAP_OPT_TIMELIMIT, $option),
36	$option,
37	ldap_get_option($link, LDAP_OPT_NETWORK_TIMEOUT, $option),
38	$option,
39	ldap_get_option($link, LDAP_OPT_TIMEOUT, $option),
40	$option,
41	ldap_get_option($link, LDAP_OPT_REFERRALS, $option),
42	$option,
43	ldap_get_option($link, LDAP_OPT_RESTART, $option),
44	$option,
45	ldap_get_option($link, LDAP_OPT_SERVER_CONTROLS, $option),
46	$option,
47	ldap_get_option($link, LDAP_OPT_CLIENT_CONTROLS, $option),
48	$option
49);
50?>
51===DONE===
52--EXPECT--
53bool(true)
54int(0)
55bool(true)
56int(123)
57bool(true)
58int(33)
59bool(true)
60int(44)
61bool(true)
62int(55)
63bool(true)
64int(0)
65bool(true)
66int(0)
67bool(false)
68int(0)
69bool(false)
70int(0)
71===DONE===
72