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_option_error.phpt ('ldap_set_option() - ldap_set_option() operation that should fail')

Script

1: <?php
2:
require "connect.inc";
3:
4:
$link ldap_connect($host$port);
5:
$controls = array(
6:     array(
7:         array(
"xid" => "1.2.752.58.10.1""iscritical" => true),
8:         array(
"xid" => "1.2.752.58.1.10""value" => "magic"),
9:     ),
10:     array(
11:         array(
"oid" => "1.2.752.58.10.1""iscritical" => true),
12:         array(
"oid" => "1.2.752.58.1.10""value" => "magic"),
13:         
"weird"
14:     
),
15:     
"notanarray"
16:
);
17:
18:
// Too few parameters
19:
var_dump(ldap_set_option());
20:
var_dump(ldap_set_option($link));
21:
var_dump(ldap_set_option($linkLDAP_OPT_PROTOCOL_VERSION));
22:
23:
// Too many parameters
24:
var_dump(ldap_set_option($linkLDAP_OPT_PROTOCOL_VERSION3"Additional data"));
25:
26:
var_dump(ldap_set_option($linkLDAP_OPT_PROTOCOL_VERSION10));
27:
28: foreach (
$controls as $control)
29:     
var_dump(ldap_set_option($linkLDAP_OPT_SERVER_CONTROLS$control));
30:
31:
var_dump(ldap_set_option($link999999999999));
32:
?>
33:
===DONE===
34:

Expected

Warning: ldap_set_option() expects exactly 3 parameters, 0 given in %s on line %d
NULL

Warning: ldap_set_option() expects exactly 3 parameters, 1 given in %s on line %d
NULL

Warning: ldap_set_option() expects exactly 3 parameters, 2 given in %s on line %d
NULL

Warning: ldap_set_option() expects exactly 3 parameters, 4 given in %s on line %d
NULL
bool(false)

Warning: ldap_set_option(): Control must have an oid key in %s on line %d
bool(false)

Warning: ldap_set_option(): The array value must contain only arrays, where each array is a control in %s on line %d
bool(false)

Warning: ldap_set_option(): Expected array value for this option in %s on line %d
bool(false)
bool(false)
===DONE===

Output

Fatal error: Uncaught ArgumentCountError: ldap_set_option() expects exactly 3 parameters, 0 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_option_error.php:19
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_option_error.php(19): ldap_set_option()
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_option_error.php on line 19

Diff

001+ Fatal error: Uncaught ArgumentCountError: ldap_set_option() expects exactly 3 parameters, 0 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_option_error.php:19
002+ Stack trace:
003+ #0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_option_error.php(19): ldap_set_option()
004+ #1 {main}
005+   thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_set_option_error.php on line 19
001- Warning: ldap_set_option() expects exactly 3 parameters, 0 given in %s on line %d
002- NULL
003- 
004- Warning: ldap_set_option() expects exactly 3 parameters, 1 given in %s on line %d
005- NULL
006- 
007- Warning: ldap_set_option() expects exactly 3 parameters, 2 given in %s on line %d
008- NULL
009- 
010- Warning: ldap_set_option() expects exactly 3 parameters, 4 given in %s on line %d
011- NULL
012- bool(false)
013- 
014- Warning: ldap_set_option(): Control must have an oid key in %s on line %d
015- bool(false)
016- 
017- Warning: ldap_set_option(): The array value must contain only arrays, where each array is a control in %s on line %d
018- bool(false)
019- 
020- Warning: ldap_set_option(): Expected array value for this option in %s on line %d
021- bool(false)
022- bool(false)
023- ===DONE===

 

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

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