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