1--TEST--
2ldap_search() - operation that should fail
3--CREDITS--
4Davide Mendolia <idaf1er@gmail.com>
5Belgian PHP Testfest 2009
6--SKIPIF--
7<?php require_once __DIR__ .'/skipif.inc'; ?>
8<?php require_once __DIR__ .'/skipifbindfailure.inc'; ?>
9--FILE--
10<?php
11include "connect.inc";
12
13$link = ldap_connect($host, $port);
14
15$dn = "dc=not-found,$base";
16$filter = "(dc=*)";
17
18$result = ldap_search();
19var_dump($result);
20
21$result = ldap_search($link, $dn, $filter);
22var_dump($result);
23
24$result = ldap_search($link, $dn, $filter, NULL);
25var_dump($result);
26
27$result = ldap_search($link, $dn, $filter, array(1 => 'top'));
28var_dump($result);
29
30$result = ldap_search(array(), $dn, $filter, array('top'));
31var_dump($result);
32
33$result = ldap_search(array($link, $link), array($dn), $filter, array('top'));
34var_dump($result);
35
36$result = ldap_search(array($link, $link), $dn, array($filter), array('top'));
37var_dump($result);
38?>
39===DONE===
40--EXPECTF--
41Warning: ldap_search() expects at least 3 parameters, 0 given in %s on line %d
42NULL
43
44Warning: ldap_search(): Search: No such object in %s on line %d
45bool(false)
46
47Warning: ldap_search() expects parameter 4 to be array, null given in %s on line %d
48NULL
49
50Warning: ldap_search(): Array initialization wrong in %s on line %d
51bool(false)
52
53Warning: ldap_search(): No links in link array in %s on line %d
54bool(false)
55
56Warning: ldap_search(): Base must either be a string, or an array with the same number of elements as the links array in %s on line %d
57bool(false)
58
59Warning: ldap_search(): Filter must either be a string, or an array with the same number of elements as the links array in %s on line %d
60bool(false)
61===DONE===
62