xref: /PHP-8.1/ext/ldap/tests/ldap_bind_error.phpt (revision 849a34e4)
1--TEST--
2ldap_bind() - Binding that should fail
3--CREDITS--
4Patrick Allaert <patrickallaert@php.net>
5# Belgian PHP Testfest 2009
6--EXTENSIONS--
7ldap
8--SKIPIF--
9<?php require_once('skipifbindfailure.inc'); ?>
10--FILE--
11<?php
12require "connect.inc";
13
14$link = ldap_connect($host, $port);
15ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
16
17// Invalid password
18var_dump(ldap_bind($link, $user, "ThisIsNotCorrect$passwd"));
19
20// Invalid DN syntax
21var_dump(ldap_bind($link, "unexistingProperty=weirdValue,$user", $passwd));
22?>
23--EXPECTF--
24Warning: ldap_bind(): Unable to bind to server: Invalid credentials in %s on line %d
25bool(false)
26
27Warning: ldap_bind(): Unable to bind to server: Invalid DN syntax in %s on line %d
28bool(false)
29