forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathldap_read_basic.phpt
64 lines (62 loc) · 1.08 KB
/
ldap_read_basic.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--TEST--
ldap_read() test
--CREDITS--
Davide Mendolia <[email protected]>
Patrick Allaert <[email protected]>
Belgian PHP Testfest 2009
--EXTENSIONS--
ldap
--SKIPIF--
<?php
require_once('skipifbindfailure.inc');
?>
--FILE--
<?php
include "connect.inc";
$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
insert_dummy_data($link, $base);
var_dump(
$result = ldap_read($link, "o=test,$base", "(o=*)"),
ldap_get_entries($link, $result)
);
?>
--CLEAN--
<?php
include "connect.inc";
$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
remove_dummy_data($link, $base);
?>
--EXPECTF--
object(LDAP\Result)#%d (0) {
}
array(2) {
["count"]=>
int(1)
[0]=>
array(6) {
["objectclass"]=>
array(3) {
["count"]=>
int(2)
[0]=>
string(3) "top"
[1]=>
string(12) "organization"
}
[0]=>
string(11) "objectclass"
["o"]=>
array(2) {
["count"]=>
int(1)
[0]=>
string(4) "test"
}
[1]=>
string(1) "o"
["count"]=>
int(2)
["dn"]=>
string(%d) "o=test,%s"
}
}