1--TEST--
2ldap_get_values_len() - Testing ldap_get_values_len() that should fail
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);
17
18// Too few parameters
19var_dump(ldap_get_values_len($link));
20var_dump(ldap_get_values_len($link, $entry));
21var_dump(ldap_get_values_len($link, $entry, "weirdAttribute", "Additional data"));
22
23var_dump(ldap_get_values_len($link, $entry, "inexistantAttribute"));
24?>
25===DONE===
26--CLEAN--
27<?php
28include "connect.inc";
29
30$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
31remove_dummy_data($link);
32?>
33--EXPECTF--
34Warning: ldap_get_values_len() expects exactly 3 parameters, 1 given in %s on line %d
35NULL
36
37Warning: ldap_get_values_len() expects exactly 3 parameters, 2 given in %s on line %d
38NULL
39
40Warning: ldap_get_values_len() expects exactly 3 parameters, 4 given in %s on line %d
41NULL
42
43Warning: ldap_get_values_len(): Cannot get the value(s) of attribute %s in %s on line %d
44bool(false)
45===DONE===
46