xref: /PHP-7.4/ext/ldap/tests/skipifcontrol.inc (revision 76e9de68)
1<?php
2require_once 'connect.inc';
3
4function skipifunsupportedcontrol($oid)
5{
6	global $host, $port, $user, $passwd, $protocol_version, $base;
7	$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
8	$result = ldap_read($link, '', '(objectClass=*)', ['supportedControl']);
9	if (!in_array($oid, ldap_get_entries($link, $result)[0]['supportedcontrol'])) {
10		die(sprintf("skip Unsupported control %s", $oid));
11	}
12}
13?>
14