summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Goldstein <cardoe@php.net>2007-12-11 17:20:58 +0000
committerDouglas Goldstein <cardoe@php.net>2007-12-11 17:20:58 +0000
commitbecf94003a1a9317695fefd3ca75a2f23f55202e (patch)
treefb9f9fd64d33e68b00b6232b6e500502adf993dc
parent0644aff5864bfeabb9f9a021e64f2aacdee7afc8 (diff)
downloadphp-git-becf94003a1a9317695fefd3ca75a2f23f55202e.tar.gz
Adding initial tests for LDAP module. Adding tests for ldap_explode_dn() function
-rw-r--r--ext/ldap/ldap_explode_dn.phpt68
1 files changed, 68 insertions, 0 deletions
diff --git a/ext/ldap/ldap_explode_dn.phpt b/ext/ldap/ldap_explode_dn.phpt
new file mode 100644
index 0000000000..1177b99f31
--- /dev/null
+++ b/ext/ldap/ldap_explode_dn.phpt
@@ -0,0 +1,68 @@
+--TEST--
+ldap_explode_dn() test
+--FILE--
+<?php
+
+var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 0));
+
+var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 0));
+
+var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 1));
+
+var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 1));
+
+var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com", 0));
+
+var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com", 1));
+
+echo "Done\n";
+
+?>
+--EXPECT--
+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)
+Done