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