PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/ldap/tests/ldap_bind_error.phpt ('ldap_bind() - Binding that should fail')

Script

1: <?php
2:
require "connect.inc";
3:
4:
$link ldap_connect($host$port);
5:
ldap_set_option($linkLDAP_OPT_PROTOCOL_VERSION$protocol_version);
6:
7:
// Invalid parameter count
8:
var_dump(ldap_bind($link$user$passwdnull));
9:
10:
// Invalid password
11:
var_dump(ldap_bind($link$user"ThisIsNotCorrect$passwd"));
12:
13:
// Invalid DN syntax
14:
var_dump(ldap_bind($link"unexistingProperty=weirdValue,$user"$passwd));
15:
?>
16:
===DONE===
17:

Expected

Warning: ldap_bind() expects at most 3 parameters, 4 given in %s on line %d
bool(false)

Warning: ldap_bind(): Unable to bind to server: Invalid credentials in %s on line %d
bool(false)

Warning: ldap_bind(): Unable to bind to server: Invalid DN syntax in %s on line %d
bool(false)
===DONE===

Output

Fatal error: Uncaught ArgumentCountError: ldap_bind() expects at most 3 parameters, 4 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_bind_error.php:8
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_bind_error.php(8): ldap_bind(Resource id #5, 'cn=Manager,dc=m...', 'secret', NULL)
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_bind_error.php on line 8

Diff

001+ Fatal error: Uncaught ArgumentCountError: ldap_bind() expects at most 3 parameters, 4 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_bind_error.php:8
002+ Stack trace:
003+ #0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_bind_error.php(8): ldap_bind(Resource id #5, 'cn=Manager,dc=m...', 'secret', NULL)
004+ #1 {main}
005+   thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_bind_error.php on line 8
001- Warning: ldap_bind() expects at most 3 parameters, 4 given in %s on line %d
002- bool(false)
003- 
004- Warning: ldap_bind(): Unable to bind to server: Invalid credentials in %s on line %d
005- bool(false)
006- 
007- Warning: ldap_bind(): Unable to bind to server: Invalid DN syntax in %s on line %d
008- bool(false)
009- ===DONE===

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (942 days ago)

Copyright © 2005-2021 The PHP Group
All rights reserved.