xref: /PHP-5.3/ext/ldap/tests/ldap_list_error.phpt (revision 17aa2607)
1--TEST--
2ldap_list() - operation that should fail
3--CREDITS--
4Patrick Allaert <patrickallaert@php.net>
5# Belgian PHP Testfest 2009
6--SKIPIF--
7<?php require_once('skipif.inc'); ?>
8--FILE--
9<?php
10include "connect.inc";
11
12$link = ldap_connect($host, $port);
13
14// Too few parameters
15var_dump(ldap_list());
16var_dump(ldap_list($link));
17var_dump(ldap_list($link, $link));
18
19// Too many parameters
20var_dump(ldap_list($link, "dc=my-domain,dc=com", "(objectClass=*)", array(), 0, 0, 0, 0 , "Additional data"));
21?>
22===DONE===
23--EXPECTF--
24Warning: ldap_list() expects at least 3 parameters, 0 given in %s on line %d
25NULL
26
27Warning: ldap_list() expects at least 3 parameters, 1 given in %s on line %d
28NULL
29
30Warning: ldap_list() expects at least 3 parameters, 2 given in %s on line %d
31NULL
32
33Warning: ldap_list() expects at most 8 parameters, 9 given in %s on line %d
34NULL
35===DONE===
36