1--TEST--
2ldap_parse_result() - Test the parsing of controls from result object
3--CREDITS--
4Côme Chilliet <mcmic@php.net>
5--SKIPIF--
6<?php require_once('skipif.inc'); ?>
7<?php require_once('skipifbindfailure.inc'); ?>
8<?php
9require_once('skipifcontrol.inc');
10skipifunsupportedcontrol(LDAP_CONTROL_PAGEDRESULTS);
11?>
12--FILE--
13<?php
14require "connect.inc";
15
16$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
17insert_dummy_data($link, $base);
18
19$dn = "$base";
20$filter = "(cn=user*)";
21var_dump(
22	ldap_control_paged_result($link, 1),
23	$result = ldap_search($link, $dn, $filter, array('cn')),
24	ldap_parse_result($link, $result, $errcode, $dn, $errmsg, $refs, $ctrls),
25	$ctrls[LDAP_CONTROL_PAGEDRESULTS]['oid'],
26	$ctrls[LDAP_CONTROL_PAGEDRESULTS]['value']['size'],
27	bin2hex($ctrls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie']),
28	ldap_get_entries($link, $result)['count']
29);
30?>
31===DONE===
32--CLEAN--
33<?php
34include "connect.inc";
35
36$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
37remove_dummy_data($link, $base);
38?>
39--EXPECTF--
40Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d
41bool(true)
42resource(%d) of type (ldap result)
43bool(true)
44string(22) "1.2.840.113556.1.4.319"
45int(%d)
46string(%d) "%s"
47int(1)
48===DONE===
49