1--TEST--
2ldap_search() test
3--CREDITS--
4Davide Mendolia <idaf1er@gmail.com>
5Patrick Allaert <patrickallaert@php.net>
6Belgian PHP Testfest 2009
7--SKIPIF--
8<?php
9require_once('skipif.inc');
10require_once('skipifbindfailure.inc');
11?>
12--FILE--
13<?php
14include "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 = "(objectclass=person)";
21var_dump(
22    $result = ldap_search($link, $dn, $filter, array('sn'), 1, 1, 3),
23    ldap_get_entries($link, $result)
24);
25?>
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--
34Warning: ldap_search(): Partial search results returned: Sizelimit exceeded in %s on line %d
35resource(%d) of type (ldap result)
36array(2) {
37  ["count"]=>
38  int(1)
39  [0]=>
40  array(4) {
41    ["sn"]=>
42    array(1) {
43      ["count"]=>
44      int(0)
45    }
46    [0]=>
47    string(2) "sn"
48    ["count"]=>
49    int(1)
50    ["dn"]=>
51    string(%d) "cn=userA,%s"
52  }
53}
54