xref: /PHP-5.5/ext/ldap/tests/ldap_dn2ufn.phpt (revision 823b31d3)
1--TEST--
2ldap_dn2ufn() test
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7
8/* Convert valid DN */
9var_dump(ldap_dn2ufn("cn=bob,dc=example,dc=com"));
10
11/* Convert valid DN */
12var_dump(ldap_dn2ufn("cn=bob,ou=users,dc=example,dc=com"));
13
14/* Convert DN with < > characters */
15var_dump(ldap_dn2ufn("cn=<bob>,dc=example,dc=com"));
16
17/* Too many parameters */
18ldap_dn2ufn("cn=bob,dc=example,dc=com", 1);
19
20/* Bad DN value */
21var_dump(ldap_dn2ufn("bob,dc=example,dc=com"));
22
23echo "Done\n";
24
25?>
26--EXPECTF--
27string(16) "bob, example.com"
28string(23) "bob, users, example.com"
29bool(false)
30
31Warning: ldap_dn2ufn() expects exactly 1 parameter, 2 given in %s on line %d
32bool(false)
33Done
34