Skip to content

Commit 108c468

Browse files
committed
adding test cases
1 parent c202e80 commit 108c468

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ext/ldap/tests/ldap_search_error.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ try {
2626
echo $exception->getMessage() . "\n";
2727
}
2828

29+
try {
30+
ldap_search($link, $dn, $filter, array('option'), false, PHP_INT_MIN);
31+
} catch (ValueError $exception) {
32+
echo $exception->getMessage() . "\n";
33+
}
34+
35+
try {
36+
ldap_search($link, $dn, $filter, array('option'), false, -1, PHP_INT_MIN);
37+
} catch (ValueError $exception) {
38+
echo $exception->getMessage() . "\n";
39+
}
40+
41+
try {
42+
ldap_search($link, $dn, $filter, array('option'), false, -1, -1, -1);
43+
} catch (ValueError $exception) {
44+
echo $exception->getMessage() . "\n";
45+
}
46+
2947
try {
3048
ldap_search(array(), $dn, $filter, array('top'));
3149
} catch (ValueError $exception) {
@@ -61,6 +79,9 @@ try {
6179
Warning: ldap_search(): Search: No such object in %s on line %d
6280
bool(false)
6381
ldap_search(): Argument #4 ($attributes) must be an array with numeric keys
82+
ldap_search(): Argument #6 ($sizelimit) must be between -1 and %d
83+
ldap_search(): Argument #7 ($timelimit) must be between -1 and %d
84+
ldap_search(): Argument #8 ($deref) must be one of the LDAP_DEREF_* constants
6485
ldap_search(): Argument #1 ($ldap) must not be empty
6586
ldap_search(): Argument #2 ($base) must be the same size as argument #1
6687
ldap_search(): Argument #3 ($filter) must be the same size as argument #1

0 commit comments

Comments
 (0)