cardoe          Thu Dec 13 17:46:46 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/ldap/tests     ldap_explode_dn.phpt 
  Log:
  expand ldap_explode_dn() tests.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/tests/ldap_explode_dn.phpt?r1=1.3.2.3&r2=1.3.2.4&diff_format=u
Index: php-src/ext/ldap/tests/ldap_explode_dn.phpt
diff -u php-src/ext/ldap/tests/ldap_explode_dn.phpt:1.3.2.3 
php-src/ext/ldap/tests/ldap_explode_dn.phpt:1.3.2.4
--- php-src/ext/ldap/tests/ldap_explode_dn.phpt:1.3.2.3 Tue Dec 11 17:35:11 2007
+++ php-src/ext/ldap/tests/ldap_explode_dn.phpt Thu Dec 13 17:46:46 2007
@@ -5,22 +5,40 @@
 --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 @@
 }
 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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to