1--TEST--
2ldap_mod_replace() - Basic modify operation
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);
15
16$entry = array(
17	"description" => "user X"
18);
19
20var_dump(
21	ldap_mod_replace($link, "cn=userA,dc=my-domain,dc=com", $entry),
22	ldap_get_entries(
23		$link,
24		ldap_search($link, "dc=my-domain,dc=com", "(description=user X)", array("description"))
25	)
26);
27?>
28===DONE===
29--CLEAN--
30<?php
31require "connect.inc";
32
33$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
34
35remove_dummy_data($link);
36?>
37--EXPECT--
38bool(true)
39array(2) {
40  ["count"]=>
41  int(1)
42  [0]=>
43  array(4) {
44    ["description"]=>
45    array(2) {
46      ["count"]=>
47      int(1)
48      [0]=>
49      string(6) "user X"
50    }
51    [0]=>
52    string(11) "description"
53    ["count"]=>
54    int(1)
55    ["dn"]=>
56    string(28) "cn=userA,dc=my-domain,dc=com"
57  }
58}
59===DONE===
60