xref: /PHP-8.1/ext/ldap/tests/ldap_dn2ufn.phpt (revision 849a34e4)
1--TEST--
2ldap_dn2ufn() test
3--EXTENSIONS--
4ldap
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/* Bad DN value */
18var_dump(ldap_dn2ufn("bob,dc=example,dc=com"));
19
20echo "Done\n";
21
22?>
23--EXPECT--
24string(16) "bob, example.com"
25string(23) "bob, users, example.com"
26bool(false)
27bool(false)
28Done
29