1--TEST--
2ldap_option_reqcert_basic() - Error test for TLS require cert ldap option
3--CREDITS--
4Edwin Hoksberg <edwin@edwinhoksberg.nl>
5--FILE--
6<?php
7require "connect.inc";
8$link = ldap_connect($host, $port);
9
10foreach([
11	LDAP_OPT_X_TLS_NEVER,
12	LDAP_OPT_X_TLS_HARD,
13	LDAP_OPT_X_TLS_DEMAND,
14	LDAP_OPT_X_TLS_ALLOW,
15	LDAP_OPT_X_TLS_TRY,
16] as $option) {
17	$result = ldap_set_option($link, LDAP_OPT_X_TLS_REQUIRE_CERT, $option);
18	var_dump($result);
19
20	ldap_get_option($link, LDAP_OPT_X_TLS_REQUIRE_CERT, $optionval);
21	var_dump($optionval);
22}
23?>
24===DONE===
25--EXPECT--
26bool(true)
27int(0)
28bool(true)
29int(1)
30bool(true)
31int(2)
32bool(true)
33int(3)
34bool(true)
35int(4)
36===DONE===
37