1--TEST--
2ldap_first_entry() - Basic ldap_first_entry test
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$result = ldap_search($link, "$base", "(objectclass=person)");
17var_dump(
18    $entry = ldap_first_entry($link, $result),
19    ldap_get_values($link, $entry, 'sn')
20);
21?>
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--
30object(LDAP\ResultEntry)#%d (0) {
31}
32array(2) {
33  [0]=>
34  string(7) "testSN%d"
35  ["count"]=>
36  int(1)
37}
38