1--TEST--
2ldap_search() test
3--CREDITS--
4Davide Mendolia <idaf1er@gmail.com>
5Patrick Allaert <patrickallaert@php.net>
6Belgian PHP Testfest 2009
7--EXTENSIONS--
8ldap
9--SKIPIF--
10<?php
11require_once('skipifbindfailure.inc');
12?>
13--FILE--
14<?php
15include "connect.inc";
16
17$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
18insert_dummy_data($link, $base);
19
20$dn = "$base";
21$filter = "(objectclass=person)";
22var_dump(
23    $result = ldap_search($link, $dn, $filter, array('sn'), 1, 1, 3),
24    ldap_get_entries($link, $result)
25);
26?>
27--CLEAN--
28<?php
29include "connect.inc";
30
31$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
32remove_dummy_data($link, $base);
33?>
34--EXPECTF--
35Warning: ldap_search(): Partial search results returned: Sizelimit exceeded in %s on line %d
36object(LDAP\Result)#%d (0) {
37}
38array(2) {
39  ["count"]=>
40  int(1)
41  [0]=>
42  array(4) {
43    ["sn"]=>
44    array(1) {
45      ["count"]=>
46      int(0)
47    }
48    [0]=>
49    string(2) "sn"
50    ["count"]=>
51    int(1)
52    ["dn"]=>
53    string(%d) "cn=userA,%s"
54  }
55}
56