Annotation of embedaddon/php/ext/ldap/tests/ldap_search_variation5.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_search() test
! 3: --CREDITS--
! 4: Davide Mendolia <idaf1er@gmail.com>
! 5: Patrick Allaert <patrickallaert@php.net>
! 6: Belgian PHP Testfest 2009
! 7: --SKIPIF--
! 8: <?php
! 9: require_once('skipif.inc');
! 10: require_once('skipifbindfailure.inc');
! 11: ?>
! 12: --FILE--
! 13: <?php
! 14: include "connect.inc";
! 15:
! 16: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 17: insert_dummy_data($link);
! 18:
! 19: $dn = "dc=my-domain,dc=com";
! 20: $filter = "(objectclass=person)";
! 21: var_dump(
! 22: $result = ldap_search($link, $dn, $filter, array('sn'), 1, 1, 3, LDAP_DEREF_SEARCHING),
! 23: ldap_get_entries($link, $result)
! 24: );
! 25: var_dump(
! 26: $result = ldap_search($link, $dn, $filter, array('sn'), 1, 1, 3, LDAP_DEREF_FINDING),
! 27: ldap_get_entries($link, $result)
! 28: );
! 29: var_dump(
! 30: $result = ldap_search($link, $dn, $filter, array('sn'), 1, 1, 3, LDAP_DEREF_ALWAYS),
! 31: ldap_get_entries($link, $result)
! 32: );
! 33: ?>
! 34: ===DONE===
! 35: --CLEAN--
! 36: <?php
! 37: include "connect.inc";
! 38:
! 39: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 40: remove_dummy_data($link);
! 41: ?>
! 42: --EXPECTF--
! 43: Warning: ldap_search(): Partial search results returned: Sizelimit exceeded in %s on line %d
! 44: resource(%d) of type (ldap result)
! 45: array(2) {
! 46: ["count"]=>
! 47: int(1)
! 48: [0]=>
! 49: array(4) {
! 50: ["sn"]=>
! 51: array(1) {
! 52: ["count"]=>
! 53: int(0)
! 54: }
! 55: [0]=>
! 56: string(2) "sn"
! 57: ["count"]=>
! 58: int(1)
! 59: ["dn"]=>
! 60: string(28) "cn=userA,dc=my-domain,dc=com"
! 61: }
! 62: }
! 63:
! 64: Warning: ldap_search(): Partial search results returned: Sizelimit exceeded in %s on line %d
! 65: resource(%d) of type (ldap result)
! 66: array(2) {
! 67: ["count"]=>
! 68: int(1)
! 69: [0]=>
! 70: array(4) {
! 71: ["sn"]=>
! 72: array(1) {
! 73: ["count"]=>
! 74: int(0)
! 75: }
! 76: [0]=>
! 77: string(2) "sn"
! 78: ["count"]=>
! 79: int(1)
! 80: ["dn"]=>
! 81: string(28) "cn=userA,dc=my-domain,dc=com"
! 82: }
! 83: }
! 84:
! 85: Warning: ldap_search(): Partial search results returned: Sizelimit exceeded in %s on line %d
! 86: resource(%d) of type (ldap result)
! 87: array(2) {
! 88: ["count"]=>
! 89: int(1)
! 90: [0]=>
! 91: array(4) {
! 92: ["sn"]=>
! 93: array(1) {
! 94: ["count"]=>
! 95: int(0)
! 96: }
! 97: [0]=>
! 98: string(2) "sn"
! 99: ["count"]=>
! 100: int(1)
! 101: ["dn"]=>
! 102: string(28) "cn=userA,dc=my-domain,dc=com"
! 103: }
! 104: }
! 105: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>