1--TEST-- 2ldap_get_attributes() - Basic ldap_get_attributes test 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$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)"); 16$entry = ldap_first_entry($link, $result); 17var_dump( 18 ldap_get_attributes($link, $entry) 19); 20?> 21===DONE=== 22--CLEAN-- 23<?php 24include "connect.inc"; 25 26$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); 27remove_dummy_data($link); 28?> 29--EXPECT-- 30array(7) { 31 ["objectClass"]=> 32 array(4) { 33 ["count"]=> 34 int(3) 35 [0]=> 36 string(3) "top" 37 [1]=> 38 string(8) "dcObject" 39 [2]=> 40 string(12) "organization" 41 } 42 [0]=> 43 string(11) "objectClass" 44 ["dc"]=> 45 array(2) { 46 ["count"]=> 47 int(1) 48 [0]=> 49 string(9) "my-domain" 50 } 51 [1]=> 52 string(2) "dc" 53 ["o"]=> 54 array(2) { 55 ["count"]=> 56 int(1) 57 [0]=> 58 string(9) "my-domain" 59 } 60 [2]=> 61 string(1) "o" 62 ["count"]=> 63 int(3) 64} 65===DONE=== 66