1--TEST--
2ldap_modify() - 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	"objectClass"	=> array(
18		"top",
19		"dcObject",
20		"organization"),
21	"dc"		=> "my-domain",
22	"o"		=> "my-domain",
23	"description"	=> "Domain description",
24);
25
26var_dump(
27	ldap_modify($link, "dc=my-domain,dc=com", $entry),
28	ldap_get_entries(
29		$link,
30		ldap_search($link, "dc=my-domain,dc=com", "(Description=Domain description)")
31	)
32);
33?>
34===DONE===
35--CLEAN--
36<?php
37require "connect.inc";
38
39$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
40
41remove_dummy_data($link);
42?>
43--EXPECT--
44bool(true)
45array(2) {
46  ["count"]=>
47  int(1)
48  [0]=>
49  array(10) {
50    ["objectclass"]=>
51    array(4) {
52      ["count"]=>
53      int(3)
54      [0]=>
55      string(3) "top"
56      [1]=>
57      string(8) "dcObject"
58      [2]=>
59      string(12) "organization"
60    }
61    [0]=>
62    string(11) "objectclass"
63    ["dc"]=>
64    array(2) {
65      ["count"]=>
66      int(1)
67      [0]=>
68      string(9) "my-domain"
69    }
70    [1]=>
71    string(2) "dc"
72    ["o"]=>
73    array(2) {
74      ["count"]=>
75      int(1)
76      [0]=>
77      string(9) "my-domain"
78    }
79    [2]=>
80    string(1) "o"
81    ["description"]=>
82    array(2) {
83      ["count"]=>
84      int(1)
85      [0]=>
86      string(18) "Domain description"
87    }
88    [3]=>
89    string(11) "description"
90    ["count"]=>
91    int(4)
92    ["dn"]=>
93    string(19) "dc=my-domain,dc=com"
94  }
95}
96===DONE===
97