1--TEST--
2ldap_first_entry() - Basic ldap_first_entry 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, $base);
15$result = ldap_search($link, "$base", "(objectclass=person)");
16var_dump(
17	$entry = ldap_first_entry($link, $result),
18	ldap_get_values($link, $entry, 'sn')
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, $base);
28?>
29--EXPECTF--
30resource(%d) of type (ldap result entry)
31array(2) {
32  [0]=>
33  string(7) "testSN%d"
34  ["count"]=>
35  int(1)
36}
37===DONE===
38