PHP  
 PHP_7_2
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:     array(
16:     ),
17: );
18:
19:
// Too few parameters
20:
var_dump(ldap_set_option());
21:
var_dump(ldap_set_option($link));
22:
var_dump(ldap_set_option($linkLDAP_OPT_PROTOCOL_VERSION));
23:
24:
// Too many parameters
25:
var_dump(ldap_set_option($linkLDAP_OPT_PROTOCOL_VERSION3"Additional data"));
26:
27:
var_dump(ldap_set_option($linkLDAP_OPT_PROTOCOL_VERSION10));
28:
29: foreach (
$controls as $control)
30:     
var_dump(ldap_set_option($linkLDAP_OPT_SERVER_CONTROLS$control));
31:
32:
var_dump(ldap_set_option($link999999999999));
33:
?>
34:
===DONE===
35:

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 non-empty array value for this option in %s on line %d
bool(false)
bool(false)
===DONE===

Output

Warning: ldap_set_option() expects exactly 3 parameters, 0 given in /var/php_gcov/PHP_7_2/ext/ldap/tests/ldap_set_option_error.php on line 20
NULL

Warning: ldap_set_option() expects exactly 3 parameters, 1 given in /var/php_gcov/PHP_7_2/ext/ldap/tests/ldap_set_option_error.php on line 21
NULL

Warning: ldap_set_option() expects exactly 3 parameters, 2 given in /var/php_gcov/PHP_7_2/ext/ldap/tests/ldap_set_option_error.php on line 22
NULL

Warning: ldap_set_option() expects exactly 3 parameters, 4 given in /var/php_gcov/PHP_7_2/ext/ldap/tests/ldap_set_option_error.php on line 25
NULL
bool(false)

Warning: ldap_set_option(): Control must have an oid key in /var/php_gcov/PHP_7_2/ext/ldap/tests/ldap_set_option_error.php on line 30
bool(false)

Warning: ldap_set_option(): The array value must contain only arrays, where each array is a control in /var/php_gcov/PHP_7_2/ext/ldap/tests/ldap_set_option_error.php on line 30
bool(false)
bool(true)
bool(false)
===DONE===

Diff

019+ bool(true)
019- 
020- Warning: ldap_set_option(): Expected non-empty array value for this option in %s on line %d
022- bool(false)

 

Generated at Sat, 16 Sep 2017 05:04:10 +0000 (5 days ago)

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