summaryrefslogtreecommitdiff
path: root/ext/ldap/tests
diff options
context:
space:
mode:
authorDouglas Goldstein <cardoe@php.net>2007-12-13 17:45:44 +0000
committerDouglas Goldstein <cardoe@php.net>2007-12-13 17:45:44 +0000
commitfde41442313719674d3d1a4425ab73f05638fb84 (patch)
tree8b478effb2323c5a7d6156556402a0d98fe22706 /ext/ldap/tests
parent2569b593f14ee4a95ea2b88c6ba09ecea67472a3 (diff)
downloadphp-git-fde41442313719674d3d1a4425ab73f05638fb84.tar.gz
expand ldap_explode_dn() tests.
Diffstat (limited to 'ext/ldap/tests')
-rw-r--r--ext/ldap/tests/ldap_explode_dn.phpt26
1 files changed, 25 insertions, 1 deletions
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--
<?php
+/* Explode with attributes */
var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 0));
+/* Explode with attributes */
var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 0));
+/* Explode without attributes */
var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 1));
+/* Explode without attributes */
var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 1));
+/* Explode with attributes and < > characters */
var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com", 0));
+/* Explode without attributes and < > characters */
var_dump(ldap_explode_dn("cn=<bob>,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