From 2013cd57cd24777897310d13ddce9cbbf98d8688 Mon Sep 17 00:00:00 2001 From: Douglas Goldstein Date: Thu, 13 Dec 2007 17:46:46 +0000 Subject: [PATCH] expand ldap_explode_dn() tests. --- ext/ldap/tests/ldap_explode_dn.phpt | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/ext/ldap/tests/ldap_explode_dn.phpt b/ext/ldap/tests/ldap_explode_dn.phpt index b630703f75..f713ca31f2 100644 --- a/ext/ldap/tests/ldap_explode_dn.phpt +++ b/ext/ldap/tests/ldap_explode_dn.phpt @@ -5,22 +5,40 @@ ldap_explode_dn() test --FILE-- characters */ var_dump(ldap_explode_dn("cn=,dc=example,dc=com", 0)); +/* Explode without attributes and < > characters */ var_dump(ldap_explode_dn("cn=,dc=example,dc=com", 1)); +/* Too few parameters */ +ldap_explode_dn("cn=bob,dc=example,dc=com"); + +/* Too many parameters */ +ldap_explode_dn("cn=bob,dc=example,dc=com", 1, 1); + +/* Bad DN value with attributes */ +var_dump(ldap_explode_dn("bob,dc=example,dc=com", 0)); + +/* Bad DN value without attributes */ +var_dump(ldap_explode_dn("bob,dc=example,dc=com", 1)); + echo "Done\n"; ?> ---EXPECT-- +--EXPECTF-- array(4) { ["count"]=> int(3) @@ -67,4 +85,10 @@ array(5) { } bool(false) bool(false) + +Warning: Wrong parameter count for ldap_explode_dn() in %s on line %d + +Warning: Wrong parameter count for ldap_explode_dn() in %s on line %d +bool(false) +bool(false) Done -- 2.50.1