mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
73 lines
1.3 KiB
PHP
73 lines
1.3 KiB
PHP
--TEST--
|
|
ldap_ldap_control_paged_result() test (fetching the first page with a pagesize=2)
|
|
--CREDITS--
|
|
Jean-Sebastien Hedde <jeanseb@au-fil-du.net>
|
|
--SKIPIF--
|
|
<?php
|
|
require_once('skipif.inc');
|
|
require_once('skipifbindfailure.inc');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
include "connect.inc";
|
|
|
|
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
|
insert_dummy_data($link, $base);
|
|
|
|
$dn = "$base";
|
|
$filter = "(cn=user*)";
|
|
var_dump(
|
|
ldap_control_paged_result($link, 2),
|
|
$result = ldap_search($link, $dn, $filter, array('cn')),
|
|
ldap_get_entries($link, $result)
|
|
);
|
|
?>
|
|
===DONE===
|
|
--CLEAN--
|
|
<?php
|
|
include "connect.inc";
|
|
|
|
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
|
remove_dummy_data($link, $base);
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
resource(%d) of type (ldap result)
|
|
array(3) {
|
|
["count"]=>
|
|
int(2)
|
|
[0]=>
|
|
array(4) {
|
|
["cn"]=>
|
|
array(2) {
|
|
["count"]=>
|
|
int(1)
|
|
[0]=>
|
|
string(5) "userA"
|
|
}
|
|
[0]=>
|
|
string(2) "cn"
|
|
["count"]=>
|
|
int(1)
|
|
["dn"]=>
|
|
string(%d) "cn=userA,%s"
|
|
}
|
|
[1]=>
|
|
array(4) {
|
|
["cn"]=>
|
|
array(2) {
|
|
["count"]=>
|
|
int(1)
|
|
[0]=>
|
|
string(5) "userB"
|
|
}
|
|
[0]=>
|
|
string(2) "cn"
|
|
["count"]=>
|
|
int(1)
|
|
["dn"]=>
|
|
string(%d) "cn=userB,%s"
|
|
}
|
|
}
|
|
===DONE===
|