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