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(true)
68array(2) {
69  ["1.2.752.58.10.1"]=>
70  array(3) {
71    ["oid"]=>
72    string(15) "1.2.752.58.10.1"
73    ["iscritical"]=>
74    bool(true)
75    ["value"]=>
76    NULL
77  }
78  ["1.2.752.58.1.10"]=>
79  array(3) {
80    ["oid"]=>
81    string(15) "1.2.752.58.1.10"
82    ["iscritical"]=>
83    bool(false)
84    ["value"]=>
85    string(5) "magic"
86  }
87}
88bool(true)
89array(2) {
90  ["1.2.752.58.10.1"]=>
91  array(3) {
92    ["oid"]=>
93    string(15) "1.2.752.58.10.1"
94    ["iscritical"]=>
95    bool(true)
96    ["value"]=>
97    NULL
98  }
99  ["1.2.752.58.1.10"]=>
100  array(3) {
101    ["oid"]=>
102    string(15) "1.2.752.58.1.10"
103    ["iscritical"]=>
104    bool(false)
105    ["value"]=>
106    string(5) "magic"
107  }
108}
109===DONE===
110