-
Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathldap_rename_basic.phpt
62 lines (60 loc) · 1.36 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
62
--TEST--
ldap_rename() - Basic ldap_rename test
--CREDITS--
Patrick Allaert <[email protected]>
# Belgian PHP Testfest 2009
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php require_once('skipifbindfailure.inc'); ?>
--FILE--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
insert_dummy_data($link);
var_dump(
ldap_rename($link, "cn=userA,dc=my-domain,dc=com", "cn=userZ", "dc=my-domain,dc=com", true)
);
$result = ldap_search($link, "dc=my-domain,dc=com", "(cn=userA)", array("cn", "sn"));
$result = ldap_search($link, "dc=my-domain,dc=com", "(cn=userZ)", array("cn", "sn"));
var_dump(ldap_get_entries($link, $result));
?>
===DONE===
--CLEAN--
<?php
include "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_rename($link, "cn=userZ,dc=my-domain,dc=com", "cn=userA", "dc=my-domain,dc=com", true);
remove_dummy_data($link);
?>
--EXPECT--
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(28) "cn=userZ,dc=my-domain,dc=com"
}
}
===DONE===