1--TEST-- 2ldap_ldap_control_paged_result() test (fetching the first page with a pagesize=2) 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*)"; 19var_dump( 20 ldap_control_paged_result($link, 2), 21 $result = ldap_search($link, $dn, $filter, array('cn')), 22 ldap_get_entries($link, $result) 23); 24?> 25===DONE=== 26--CLEAN-- 27<?php 28include "connect.inc"; 29 30$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); 31remove_dummy_data($link, $base); 32?> 33--EXPECTF-- 34bool(true) 35resource(%d) of type (ldap result) 36array(3) { 37 ["count"]=> 38 int(2) 39 [0]=> 40 array(4) { 41 ["cn"]=> 42 array(2) { 43 ["count"]=> 44 int(1) 45 [0]=> 46 string(5) "userA" 47 } 48 [0]=> 49 string(2) "cn" 50 ["count"]=> 51 int(1) 52 ["dn"]=> 53 string(%d) "cn=userA,%s" 54 } 55 [1]=> 56 array(4) { 57 ["cn"]=> 58 array(2) { 59 ["count"]=> 60 int(1) 61 [0]=> 62 string(5) "userB" 63 } 64 [0]=> 65 string(2) "cn" 66 ["count"]=> 67 int(1) 68 ["dn"]=> 69 string(%d) "cn=userB,%s" 70 } 71} 72===DONE=== 73