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

1.1     ! misho       1: --TEST--
        !             2: ldap_ldap_control_paged_result() test (fetching the first page then the next final page)
        !             3: --CREDITS--
        !             4: Jean-Sebastien Hedde <jeanseb@au-fil-du.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 = "(cn=*)";
        !            19: $cookie = '';
        !            20: var_dump(
        !            21:        ldap_control_paged_result($link, 2, true, $cookie),
        !            22:        $result = ldap_search($link, $dn, $filter, array('cn')),
        !            23:        ldap_get_entries($link, $result),
        !            24:        ldap_control_paged_result_response($link, $result, $cookie),
        !            25:        ldap_control_paged_result($link, 20, true, $cookie),
        !            26:        $result = ldap_search($link, $dn, $filter, array('cn')),
        !            27:        ldap_get_entries($link, $result)
        !            28: );
        !            29: ?>
        !            30: ===DONE===
        !            31: --CLEAN--
        !            32: <?php
        !            33: include "connect.inc";
        !            34: 
        !            35: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
        !            36: remove_dummy_data($link);
        !            37: ?>
        !            38: --EXPECTF--
        !            39: bool(true)
        !            40: resource(%d) of type (ldap result)
        !            41: array(3) {
        !            42:   ["count"]=>
        !            43:   int(2)
        !            44:   [0]=>
        !            45:   array(4) {
        !            46:     ["cn"]=>
        !            47:     array(2) {
        !            48:       ["count"]=>
        !            49:       int(1)
        !            50:       [0]=>
        !            51:       string(5) "userA"
        !            52:     }
        !            53:     [0]=>
        !            54:     string(2) "cn"
        !            55:     ["count"]=>
        !            56:     int(1)
        !            57:     ["dn"]=>
        !            58:     string(28) "cn=userA,dc=my-domain,dc=com"
        !            59:   }
        !            60:   [1]=>
        !            61:   array(4) {
        !            62:     ["cn"]=>
        !            63:     array(2) {
        !            64:       ["count"]=>
        !            65:       int(1)
        !            66:       [0]=>
        !            67:       string(5) "userB"
        !            68:     }
        !            69:     [0]=>
        !            70:     string(2) "cn"
        !            71:     ["count"]=>
        !            72:     int(1)
        !            73:     ["dn"]=>
        !            74:     string(28) "cn=userB,dc=my-domain,dc=com"
        !            75:   }
        !            76: }
        !            77: bool(true)
        !            78: bool(true)
        !            79: resource(%d) of type (ldap result)
        !            80: array(2) {
        !            81:   ["count"]=>
        !            82:   int(1)
        !            83:   [0]=>
        !            84:   array(4) {
        !            85:     ["cn"]=>
        !            86:     array(2) {
        !            87:       ["count"]=>
        !            88:       int(1)
        !            89:       [0]=>
        !            90:       string(5) "userC"
        !            91:     }
        !            92:     [0]=>
        !            93:     string(2) "cn"
        !            94:     ["count"]=>
        !            95:     int(1)
        !            96:     ["dn"]=>
        !            97:     string(37) "cn=userC,cn=userB,dc=my-domain,dc=com"
        !            98:   }
        !            99: }
        !           100: ===DONE===

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