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_explode_dn.phpt ('ldap_explode_dn() test')

Script

1: <?php
2:
3:
/* Explode with attributes */
4:
var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com"0));
5:
6:
/* Explode with attributes */
7:
var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com"0));
8:
9:
/* Explode without attributes */
10:
var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com"1));
11:
12:
/* Explode without attributes */
13:
var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com"1));
14:
15:
/* Explode with attributes and < > characters */
16:
var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com"0));
17:
18:
/* Explode without attributes and < > characters */
19:
var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com"1));
20:
21:
/* Too few parameters */
22:
ldap_explode_dn("cn=bob,dc=example,dc=com");
23:
24:
/* Too many parameters */
25:
ldap_explode_dn("cn=bob,dc=example,dc=com"11);
26:
27:
/* Bad DN value with attributes */
28:
var_dump(ldap_explode_dn("bob,dc=example,dc=com"0));
29:
30:
/* Bad DN value without attributes */
31:
var_dump(ldap_explode_dn("bob,dc=example,dc=com"1));
32:
33: echo 
"Done\n";
34:
35:
?>
36:

Expected

array(4) {
  ["count"]=>
  int(3)
  [0]=>
  string(6) "cn=bob"
  [1]=>
  string(10) "dc=example"
  [2]=>
  string(6) "dc=com"
}
array(5) {
  ["count"]=>
  int(4)
  [0]=>
  string(6) "cn=bob"
  [1]=>
  string(8) "ou=users"
  [2]=>
  string(10) "dc=example"
  [3]=>
  string(6) "dc=com"
}
array(4) {
  ["count"]=>
  int(3)
  [0]=>
  string(3) "bob"
  [1]=>
  string(7) "example"
  [2]=>
  string(3) "com"
}
array(5) {
  ["count"]=>
  int(4)
  [0]=>
  string(3) "bob"
  [1]=>
  string(5) "users"
  [2]=>
  string(7) "example"
  [3]=>
  string(3) "com"
}
bool(false)
bool(false)

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

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

Output

array(4) {
  ["count"]=>
  int(3)
  [0]=>
  string(6) "cn=bob"
  [1]=>
  string(10) "dc=example"
  [2]=>
  string(6) "dc=com"
}
array(5) {
  ["count"]=>
  int(4)
  [0]=>
  string(6) "cn=bob"
  [1]=>
  string(8) "ou=users"
  [2]=>
  string(10) "dc=example"
  [3]=>
  string(6) "dc=com"
}
array(4) {
  ["count"]=>
  int(3)
  [0]=>
  string(3) "bob"
  [1]=>
  string(7) "example"
  [2]=>
  string(3) "com"
}
array(5) {
  ["count"]=>
  int(4)
  [0]=>
  string(3) "bob"
  [1]=>
  string(5) "users"
  [2]=>
  string(7) "example"
  [3]=>
  string(3) "com"
}
bool(false)
bool(false)

Fatal error: Uncaught ArgumentCountError: ldap_explode_dn() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_explode_dn.php:22
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_explode_dn.php(22): ldap_explode_dn('cn=bob,dc=examp...')
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_explode_dn.php on line 22

Diff

048+ Fatal error: Uncaught ArgumentCountError: ldap_explode_dn() expects exactly 2 parameters, 1 given in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_explode_dn.php:22
049+ Stack trace:
050+ #0 /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_explode_dn.php(22): ldap_explode_dn('cn=bob,dc=examp...')
051+ #1 {main}
052+   thrown in /var/php_gcov/PHP_HEAD/ext/ldap/tests/ldap_explode_dn.php on line 22
048- Warning: ldap_explode_dn() expects exactly 2 parameters, 1 given in %s on line %d
049- 
050- Warning: ldap_explode_dn() expects exactly 2 parameters, 3 given in %s on line %d
051- bool(false)
052- bool(false)
053- Done

 

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

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