forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathldap_rename_basic.phpt
61 lines (59 loc) · 1.22 KB
/
ldap_rename_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
--TEST--
ldap_rename() - Basic ldap_rename test
--CREDITS--
Patrick Allaert <[email protected]>
# Belgian PHP Testfest 2009
--EXTENSIONS--
ldap
--SKIPIF--
<?php require_once('skipifbindfailure.inc'); ?>
--FILE--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
insert_dummy_data($link, $base);
var_dump(
ldap_rename($link, "cn=userA,$base", "cn=userZ", "$base", true)
);
$result = ldap_search($link, "$base", "(cn=userA)", array("cn", "sn"));
$result = ldap_search($link, "$base", "(cn=userZ)", array("cn", "sn"));
var_dump(ldap_get_entries($link, $result));
?>
--CLEAN--
<?php
include "connect.inc";
$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
ldap_rename($link, "cn=userZ,$base", "cn=userA", "$base", true);
remove_dummy_data($link, $base);
?>
--EXPECTF--
bool(true)
array(2) {
["count"]=>
int(1)
[0]=>
array(6) {
["sn"]=>
array(2) {
["count"]=>
int(1)
[0]=>
string(7) "testSN1"
}
[0]=>
string(2) "sn"
["cn"]=>
array(2) {
["count"]=>
int(1)
[0]=>
string(5) "userZ"
}
[1]=>
string(2) "cn"
["count"]=>
int(2)
["dn"]=>
string(%d) "cn=userZ,%s"
}
}