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

Script

1: <?php
2:
require "connect.inc";
3:
4:
$link ldap_connect_and_bind($host$port$user$passwd$protocol_version);
5:
insert_dummy_data($link$base);
6:
7:
// Too few parameters
8:
var_dump(ldap_compare($link));
9:
var_dump(ldap_compare($link$link));
10:
var_dump(ldap_compare($link$link$link));
11:
12:
// Too many parameters
13:
var_dump(ldap_compare($link$link$link$link, [], "Additional data"));
14:
15:
var_dump(
16:     
ldap_compare($link"cn=userNotAvailable,$base""sn""testSN1"),
17:     
ldap_error($link),
18:     
ldap_errno($link)
19: );
20:
?>
21:
===DONE===
22:

Expected

Warning: ldap_compare() expects at least 4 parameters, 1 given in %s on line %d
NULL

Warning: ldap_compare() expects at least 4 parameters, 2 given in %s on line %d
NULL

Warning: ldap_compare() expects at least 4 parameters, 3 given in %s on line %d
NULL

Warning: ldap_compare() expects at most 5 parameters, 6 given in %s on line %d
NULL

Warning: ldap_compare(): Compare: No such object in %s on line %d
int(-1)
string(14) "No such object"
int(32)
===DONE===

Output

Fatal error: Uncaught ArgumentCountError: ldap_compare() expects at least 4 parameters, 1 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_compare_error.php:8
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_compare_error.php(8): ldap_compare(Resource id #5)
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_compare_error.php on line 8

Diff

001+ Fatal error: Uncaught ArgumentCountError: ldap_compare() expects at least 4 parameters, 1 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_compare_error.php:8
002+ Stack trace:
003+ #0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_compare_error.php(8): ldap_compare(Resource id #5)
004+ #1 {main}
005+   thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_compare_error.php on line 8
001- Warning: ldap_compare() expects at least 4 parameters, 1 given in %s on line %d
002- NULL
003- 
004- Warning: ldap_compare() expects at least 4 parameters, 2 given in %s on line %d
005- NULL
006- 
007- Warning: ldap_compare() expects at least 4 parameters, 3 given in %s on line %d
008- NULL
009- 
010- Warning: ldap_compare() expects at most 5 parameters, 6 given in %s on line %d
011- NULL
012- 
013- Warning: ldap_compare(): Compare: No such object in %s on line %d
014- int(-1)
015- string(14) "No such object"
016- int(32)
017- ===DONE===

 

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

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