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