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