1--TEST--
2ldap_next_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_list($link, "$base", "(objectClass=person)");
16$entry = ldap_first_entry($link, $result);
17var_dump(
18    $entry = ldap_next_entry($link, $entry),
19    ldap_get_values($link, $entry, 'sn'),
20    $entry = ldap_next_entry($link, $entry)
21);
22?>
23--CLEAN--
24<?php
25include "connect.inc";
26
27$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
28remove_dummy_data($link, $base);
29?>
30--EXPECTF--
31resource(%d) of type (ldap result entry)
32array(2) {
33  [0]=>
34  string(7) "testSN%d"
35  ["count"]=>
36  int(1)
37}
38bool(false)
39