1--TEST--
2ldap_mod_replace() - Basic modify operation
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);
16
17$entry = array(
18    "description" => "user X"
19);
20
21var_dump(
22    ldap_mod_replace($link, "cn=userA,$base", $entry),
23    ldap_get_entries(
24        $link,
25        ldap_search($link, "$base", "(description=user X)", array("description"))
26    )
27);
28?>
29--CLEAN--
30<?php
31require "connect.inc";
32
33$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
34
35remove_dummy_data($link, $base);
36?>
37--EXPECTF--
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(%d) "cn=userA,%s"
57  }
58}
59