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_set_rebind_proc_error.phpt ('ldap_set_rebind_proc() - Testing ldap_set_rebind_proc() that should fail')

Script

1: <?php
2:
require "connect.inc";
3:
4: function 
rebind_proc ($ds$ldap_url) {
5:   global 
$user;
6:   global 
$passwd;
7:   global 
$protocol_version;
8:
9:   
// required by most modern LDAP servers, use LDAPv3
10:   
ldap_set_option($aLDAP_OPT_PROTOCOL_VERSION$protocol_version);
11:
12:   if (!
ldap_bind($a$user$passwd)) {
13:         print 
"Cannot bind";
14:   }
15: }
16:
17:
$link ldap_connect($host$port);
18:
var_dump(ldap_set_rebind_proc($link));
19:
var_dump(ldap_set_rebind_proc($link"rebind_proc""Additional data"));
20:
var_dump(ldap_set_rebind_proc($link"rebind_proc_inexistent"));
21:
?>
22:
===DONE===
23:

Expected

Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 1 given in %s on line %d
bool(false)

Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 3 given in %s on line %d
bool(false)

Warning: ldap_set_rebind_proc(): Two arguments expected for 'rebind_proc_inexistent' to be a valid callback in %s on line %d
bool(false)
===DONE===

Output

Fatal error: Uncaught ArgumentCountError: ldap_set_rebind_proc() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_rebind_proc_error.php:18
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_rebind_proc_error.php(18): ldap_set_rebind_proc(Resource id #5)
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_rebind_proc_error.php on line 18

Diff

001+ Fatal error: Uncaught ArgumentCountError: ldap_set_rebind_proc() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_rebind_proc_error.php:18
002+ Stack trace:
003+ #0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_rebind_proc_error.php(18): ldap_set_rebind_proc(Resource id #5)
004+ #1 {main}
005+   thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_rebind_proc_error.php on line 18
001- Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 1 given in %s on line %d
002- bool(false)
003- 
004- Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 3 given in %s on line %d
005- bool(false)
006- 
007- Warning: ldap_set_rebind_proc(): Two arguments expected for 'rebind_proc_inexistent' to be a valid callback 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.