mirror of
https://github.com/php/php-src.git
synced 2026-03-27 01:32:22 +01:00
Adding initial tests for LDAP module. Adding tests for ldap_explode_dn() function
This commit is contained in:
68
ext/ldap/tests/ldap_explode_dn.phpt
Normal file
68
ext/ldap/tests/ldap_explode_dn.phpt
Normal file
@@ -0,0 +1,68 @@
|
||||
--TEST--
|
||||
ldap_explode_dn() test
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 0));
|
||||
|
||||
var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 0));
|
||||
|
||||
var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 1));
|
||||
|
||||
var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 1));
|
||||
|
||||
var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com", 0));
|
||||
|
||||
var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com", 1));
|
||||
|
||||
echo "Done\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
string(6) "cn=bob"
|
||||
[1]=>
|
||||
string(10) "dc=example"
|
||||
[2]=>
|
||||
string(6) "dc=com"
|
||||
}
|
||||
array(5) {
|
||||
["count"]=>
|
||||
int(4)
|
||||
[0]=>
|
||||
string(6) "cn=bob"
|
||||
[1]=>
|
||||
string(8) "ou=users"
|
||||
[2]=>
|
||||
string(10) "dc=example"
|
||||
[3]=>
|
||||
string(6) "dc=com"
|
||||
}
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
string(3) "bob"
|
||||
[1]=>
|
||||
string(7) "example"
|
||||
[2]=>
|
||||
string(3) "com"
|
||||
}
|
||||
array(5) {
|
||||
["count"]=>
|
||||
int(4)
|
||||
[0]=>
|
||||
string(3) "bob"
|
||||
[1]=>
|
||||
string(5) "users"
|
||||
[2]=>
|
||||
string(7) "example"
|
||||
[3]=>
|
||||
string(3) "com"
|
||||
}
|
||||
bool(false)
|
||||
bool(false)
|
||||
Done
|
||||
Reference in New Issue
Block a user