1--TEST--
2ldap_ldap_control_paged_result() test (fetching the first page then the next final page)
3--CREDITS--
4Jean-Sebastien Hedde <jeanseb@au-fil-du.net>
5--SKIPIF--
6<?php
7require_once('skipif.inc');
8require_once('skipifbindfailure.inc');
9?>
10--FILE--
11<?php
12include "connect.inc";
13
14$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
15insert_dummy_data($link, $base);
16
17$dn = "$base";
18$filter = "(cn=user*)";
19$cookie = '';
20var_dump(
21	ldap_control_paged_result($link, 2, true, $cookie),
22	$result = ldap_search($link, $dn, $filter, array('cn')),
23	ldap_get_entries($link, $result),
24	ldap_control_paged_result_response($link, $result, $cookie),
25	ldap_control_paged_result($link, 20, true, $cookie),
26	$result = ldap_search($link, $dn, $filter, array('cn')),
27	ldap_get_entries($link, $result)
28);
29?>
30===DONE===
31--CLEAN--
32<?php
33include "connect.inc";
34
35$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
36remove_dummy_data($link, $base);
37?>
38--EXPECTF--
39Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d
40
41Deprecated: Function ldap_control_paged_result_response() is deprecated in %s.php on line %d
42
43Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d
44bool(true)
45resource(%d) of type (ldap result)
46array(3) {
47  ["count"]=>
48  int(2)
49  [0]=>
50  array(4) {
51    ["cn"]=>
52    array(2) {
53      ["count"]=>
54      int(1)
55      [0]=>
56      string(5) "userA"
57    }
58    [0]=>
59    string(2) "cn"
60    ["count"]=>
61    int(1)
62    ["dn"]=>
63    string(%d) "cn=userA,%s"
64  }
65  [1]=>
66  array(4) {
67    ["cn"]=>
68    array(2) {
69      ["count"]=>
70      int(1)
71      [0]=>
72      string(5) "userB"
73    }
74    [0]=>
75    string(2) "cn"
76    ["count"]=>
77    int(1)
78    ["dn"]=>
79    string(%d) "cn=userB,%s"
80  }
81}
82bool(true)
83bool(true)
84resource(%d) of type (ldap result)
85array(2) {
86  ["count"]=>
87  int(1)
88  [0]=>
89  array(4) {
90    ["cn"]=>
91    array(2) {
92      ["count"]=>
93      int(1)
94      [0]=>
95      string(5) "userC"
96    }
97    [0]=>
98    string(2) "cn"
99    ["count"]=>
100    int(1)
101    ["dn"]=>
102    string(%d) "cn=userC,cn=userB,%s"
103  }
104}
105===DONE===
106