cardoe          Thu Dec 13 18:00:46 2007 UTC

  Modified files:              
    /php-src/ext/ldap/tests     ldap_dn2ufn.phpt 
  Log:
  add tests for ldap_dn2ufn()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/tests/ldap_dn2ufn.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/ldap/tests/ldap_dn2ufn.phpt
diff -u /dev/null php-src/ext/ldap/tests/ldap_dn2ufn.phpt:1.2
--- /dev/null   Thu Dec 13 18:00:46 2007
+++ php-src/ext/ldap/tests/ldap_dn2ufn.phpt     Thu Dec 13 18:00:46 2007
@@ -0,0 +1,33 @@
+--TEST--
+ldap_dn2ufn() test
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+/* Convert valid DN */
+var_dump(ldap_dn2ufn("cn=bob,dc=example,dc=com"));
+
+/* Convert valid DN */
+var_dump(ldap_dn2ufn("cn=bob,ou=users,dc=example,dc=com"));
+
+/* Convert DN with < > characters */
+var_dump(ldap_dn2ufn("cn=<bob>,dc=example,dc=com"));
+
+/* Too many parameters */
+ldap_dn2ufn("cn=bob,dc=example,dc=com", 1);
+
+/* Bad DN value */
+var_dump(ldap_dn2ufn("bob,dc=example,dc=com"));
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+string(16) "bob, example.com"
+string(23) "bob, users, example.com"
+bool(false)
+
+Warning: Wrong parameter count for ldap_dn2ufn() in %s on line %d
+bool(false)
+Done

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

Reply via email to