php-src/ext/ldap/tests/ldap_dn2ufn.phpt
Antony Dovgal 823b31d30c fix tests
2008-04-22 13:31:25 +00:00

34 lines
686 B
PHP

--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: ldap_dn2ufn() expects exactly 1 parameter, 2 given in %s on line %d
bool(false)
Done