Annotation of embedaddon/php/ext/ldap/tests/bug48441.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: ldap_search() bug 48441 - options persists after specifying them in ldap_search
        !             3: --CREDITS--
        !             4: Patrick Allaert <patrickallaert@php.net>
        !             5: --SKIPIF--
        !             6: <?php
        !             7: require_once('skipif.inc');
        !             8: require_once('skipifbindfailure.inc');
        !             9: ?>
        !            10: --FILE--
        !            11: <?php
        !            12: include "connect.inc";
        !            13: 
        !            14: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
        !            15: insert_dummy_data($link);
        !            16: 
        !            17: $dn = "dc=my-domain,dc=com";
        !            18: $filter = "(objectclass=person)";
        !            19: 
        !            20: var_dump(
        !            21:        $result = ldap_search($link, $dn, $filter, array('sn')),
        !            22:        ldap_get_entries($link, $result)
        !            23: );
        !            24: var_dump(
        !            25:        $result = ldap_search($link, $dn, $filter, array('sn'), 1, 1, 1, LDAP_DEREF_ALWAYS),
        !            26:        ldap_get_entries($link, $result)
        !            27: );
        !            28: var_dump(
        !            29:        $result = ldap_search($link, $dn, $filter, array('sn')),
        !            30:        ldap_get_entries($link, $result)
        !            31: );
        !            32: ?>
        !            33: ===DONE===
        !            34: --CLEAN--
        !            35: <?php
        !            36: include "connect.inc";
        !            37: 
        !            38: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
        !            39: remove_dummy_data($link);
        !            40: ?>
        !            41: --EXPECTF--
        !            42: resource(%d) of type (ldap result)
        !            43: array(4) {
        !            44:   ["count"]=>
        !            45:   int(3)
        !            46:   [0]=>
        !            47:   array(4) {
        !            48:     ["sn"]=>
        !            49:     array(2) {
        !            50:       ["count"]=>
        !            51:       int(1)
        !            52:       [0]=>
        !            53:       string(7) "testSN1"
        !            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:   [1]=>
        !            63:   array(4) {
        !            64:     ["sn"]=>
        !            65:     array(2) {
        !            66:       ["count"]=>
        !            67:       int(1)
        !            68:       [0]=>
        !            69:       string(7) "testSN2"
        !            70:     }
        !            71:     [0]=>
        !            72:     string(2) "sn"
        !            73:     ["count"]=>
        !            74:     int(1)
        !            75:     ["dn"]=>
        !            76:     string(28) "cn=userB,dc=my-domain,dc=com"
        !            77:   }
        !            78:   [2]=>
        !            79:   array(4) {
        !            80:     ["sn"]=>
        !            81:     array(2) {
        !            82:       ["count"]=>
        !            83:       int(1)
        !            84:       [0]=>
        !            85:       string(7) "testSN3"
        !            86:     }
        !            87:     [0]=>
        !            88:     string(2) "sn"
        !            89:     ["count"]=>
        !            90:     int(1)
        !            91:     ["dn"]=>
        !            92:     string(37) "cn=userC,cn=userB,dc=my-domain,dc=com"
        !            93:   }
        !            94: }
        !            95: 
        !            96: Warning: ldap_search(): Partial search results returned: Sizelimit exceeded in %s on line %d
        !            97: resource(%d) of type (ldap result)
        !            98: array(2) {
        !            99:   ["count"]=>
        !           100:   int(1)
        !           101:   [0]=>
        !           102:   array(4) {
        !           103:     ["sn"]=>
        !           104:     array(1) {
        !           105:       ["count"]=>
        !           106:       int(0)
        !           107:     }
        !           108:     [0]=>
        !           109:     string(2) "sn"
        !           110:     ["count"]=>
        !           111:     int(1)
        !           112:     ["dn"]=>
        !           113:     string(28) "cn=userA,dc=my-domain,dc=com"
        !           114:   }
        !           115: }
        !           116: resource(%d) of type (ldap result)
        !           117: array(4) {
        !           118:   ["count"]=>
        !           119:   int(3)
        !           120:   [0]=>
        !           121:   array(4) {
        !           122:     ["sn"]=>
        !           123:     array(2) {
        !           124:       ["count"]=>
        !           125:       int(1)
        !           126:       [0]=>
        !           127:       string(7) "testSN1"
        !           128:     }
        !           129:     [0]=>
        !           130:     string(2) "sn"
        !           131:     ["count"]=>
        !           132:     int(1)
        !           133:     ["dn"]=>
        !           134:     string(28) "cn=userA,dc=my-domain,dc=com"
        !           135:   }
        !           136:   [1]=>
        !           137:   array(4) {
        !           138:     ["sn"]=>
        !           139:     array(2) {
        !           140:       ["count"]=>
        !           141:       int(1)
        !           142:       [0]=>
        !           143:       string(7) "testSN2"
        !           144:     }
        !           145:     [0]=>
        !           146:     string(2) "sn"
        !           147:     ["count"]=>
        !           148:     int(1)
        !           149:     ["dn"]=>
        !           150:     string(28) "cn=userB,dc=my-domain,dc=com"
        !           151:   }
        !           152:   [2]=>
        !           153:   array(4) {
        !           154:     ["sn"]=>
        !           155:     array(2) {
        !           156:       ["count"]=>
        !           157:       int(1)
        !           158:       [0]=>
        !           159:       string(7) "testSN3"
        !           160:     }
        !           161:     [0]=>
        !           162:     string(2) "sn"
        !           163:     ["count"]=>
        !           164:     int(1)
        !           165:     ["dn"]=>
        !           166:     string(37) "cn=userC,cn=userB,dc=my-domain,dc=com"
        !           167:   }
        !           168: }
        !           169: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>