1--TEST--
2ldap_modify() - 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    "objectClass"	=> array(
19        "top",
20        "organization"),
21    "o"		=> "test",
22    "description"	=> "Domain description",
23);
24
25var_dump(
26    ldap_modify($link, "o=test,$base", $entry),
27    ldap_get_entries(
28        $link,
29        ldap_search($link, "$base", "(Description=Domain description)")
30    )
31);
32?>
33--CLEAN--
34<?php
35require "connect.inc";
36
37$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
38
39remove_dummy_data($link, $base);
40?>
41--EXPECTF--
42bool(true)
43array(2) {
44  ["count"]=>
45  int(1)
46  [0]=>
47  array(8) {
48    ["objectclass"]=>
49    array(3) {
50      ["count"]=>
51      int(2)
52      [0]=>
53      string(3) "top"
54      [1]=>
55      string(12) "organization"
56    }
57    [0]=>
58    string(11) "objectclass"
59    ["o"]=>
60    array(2) {
61      ["count"]=>
62      int(1)
63      [0]=>
64      string(4) "test"
65    }
66    [1]=>
67    string(1) "o"
68    ["description"]=>
69    array(2) {
70      ["count"]=>
71      int(1)
72      [0]=>
73      string(18) "Domain description"
74    }
75    [2]=>
76    string(11) "description"
77    ["count"]=>
78    int(3)
79    ["dn"]=>
80    string(%d) "o=test,%s"
81  }
82}
83