1--TEST--
2ldap_rename() - Basic ldap_rename test
3--CREDITS--
4Patrick Allaert <patrickallaert@php.net>
5# Belgian PHP Testfest 2009
6--EXTENSIONS--
7ldap
8--SKIPIF--
9<?php require_once('skipifbindfailure.inc'); ?>
10--FILE--
11<?php
12require "connect.inc";
13
14$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
15insert_dummy_data($link, $base);
16var_dump(
17    ldap_rename($link, "cn=userA,$base", "cn=userZ", "$base", true)
18);
19$result = ldap_search($link, "$base", "(cn=userA)", array("cn", "sn"));
20$result = ldap_search($link, "$base", "(cn=userZ)", array("cn", "sn"));
21var_dump(ldap_get_entries($link, $result));
22?>
23--CLEAN--
24<?php
25include "connect.inc";
26
27$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
28ldap_rename($link, "cn=userZ,$base", "cn=userA", "$base", true);
29remove_dummy_data($link, $base);
30?>
31--EXPECTF--
32bool(true)
33array(2) {
34  ["count"]=>
35  int(1)
36  [0]=>
37  array(6) {
38    ["sn"]=>
39    array(2) {
40      ["count"]=>
41      int(1)
42      [0]=>
43      string(7) "testSN1"
44    }
45    [0]=>
46    string(2) "sn"
47    ["cn"]=>
48    array(2) {
49      ["count"]=>
50      int(1)
51      [0]=>
52      string(5) "userZ"
53    }
54    [1]=>
55    string(2) "cn"
56    ["count"]=>
57    int(2)
58    ["dn"]=>
59    string(%d) "cn=userZ,%s"
60  }
61}
62