Annotation of embedaddon/php/ext/ldap/tests/ldap_get_values_len_error.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: ldap_get_values_len() - Testing ldap_get_values_len() that should fail
3: --CREDITS--
4: Patrick 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
11: require "connect.inc";
12:
13: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
14: insert_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
19: var_dump(ldap_get_values_len($link));
20: var_dump(ldap_get_values_len($link, $entry));
21: var_dump(ldap_get_values_len($link, $entry, "weirdAttribute", "Additional data"));
22:
1.1.1.2 ! misho 23: var_dump(ldap_get_values_len($link, $entry, "inexistentAttribute"));
1.1 misho 24: ?>
25: ===DONE===
26: --CLEAN--
27: <?php
28: include "connect.inc";
29:
30: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
31: remove_dummy_data($link);
32: ?>
33: --EXPECTF--
34: Warning: ldap_get_values_len() expects exactly 3 parameters, 1 given in %s on line %d
35: NULL
36:
37: Warning: ldap_get_values_len() expects exactly 3 parameters, 2 given in %s on line %d
38: NULL
39:
40: Warning: ldap_get_values_len() expects exactly 3 parameters, 4 given in %s on line %d
41: NULL
42:
43: Warning: ldap_get_values_len(): Cannot get the value(s) of attribute %s in %s on line %d
44: bool(false)
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>