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

1.1     ! misho       1: --TEST--
        !             2: ldap_explode_dn() test
        !             3: --SKIPIF--
        !             4: <?php require_once('skipif.inc'); ?>
        !             5: --FILE--
        !             6: <?php
        !             7: 
        !             8: /* Explode with attributes */
        !             9: var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 0));
        !            10: 
        !            11: /* Explode with attributes */
        !            12: var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 0));
        !            13: 
        !            14: /* Explode without attributes */
        !            15: var_dump(ldap_explode_dn("cn=bob,dc=example,dc=com", 1));
        !            16: 
        !            17: /* Explode without attributes */
        !            18: var_dump(ldap_explode_dn("cn=bob,ou=users,dc=example,dc=com", 1));
        !            19: 
        !            20: /* Explode with attributes and < > characters */
        !            21: var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com", 0));
        !            22: 
        !            23: /* Explode without attributes and < > characters */
        !            24: var_dump(ldap_explode_dn("cn=<bob>,dc=example,dc=com", 1));
        !            25: 
        !            26: /* Too few parameters */
        !            27: ldap_explode_dn("cn=bob,dc=example,dc=com");
        !            28: 
        !            29: /* Too many parameters */
        !            30: ldap_explode_dn("cn=bob,dc=example,dc=com", 1, 1);
        !            31: 
        !            32: /* Bad DN value with attributes */
        !            33: var_dump(ldap_explode_dn("bob,dc=example,dc=com", 0));
        !            34: 
        !            35: /* Bad DN value without attributes */
        !            36: var_dump(ldap_explode_dn("bob,dc=example,dc=com", 1));
        !            37: 
        !            38: echo "Done\n";
        !            39: 
        !            40: ?>
        !            41: --EXPECTF--
        !            42: array(4) {
        !            43:   ["count"]=>
        !            44:   int(3)
        !            45:   [0]=>
        !            46:   string(6) "cn=bob"
        !            47:   [1]=>
        !            48:   string(10) "dc=example"
        !            49:   [2]=>
        !            50:   string(6) "dc=com"
        !            51: }
        !            52: array(5) {
        !            53:   ["count"]=>
        !            54:   int(4)
        !            55:   [0]=>
        !            56:   string(6) "cn=bob"
        !            57:   [1]=>
        !            58:   string(8) "ou=users"
        !            59:   [2]=>
        !            60:   string(10) "dc=example"
        !            61:   [3]=>
        !            62:   string(6) "dc=com"
        !            63: }
        !            64: array(4) {
        !            65:   ["count"]=>
        !            66:   int(3)
        !            67:   [0]=>
        !            68:   string(3) "bob"
        !            69:   [1]=>
        !            70:   string(7) "example"
        !            71:   [2]=>
        !            72:   string(3) "com"
        !            73: }
        !            74: array(5) {
        !            75:   ["count"]=>
        !            76:   int(4)
        !            77:   [0]=>
        !            78:   string(3) "bob"
        !            79:   [1]=>
        !            80:   string(5) "users"
        !            81:   [2]=>
        !            82:   string(7) "example"
        !            83:   [3]=>
        !            84:   string(3) "com"
        !            85: }
        !            86: bool(false)
        !            87: bool(false)
        !            88: 
        !            89: Warning: ldap_explode_dn() expects exactly 2 parameters, 1 given in %s on line %d
        !            90: 
        !            91: Warning: ldap_explode_dn() expects exactly 2 parameters, 3 given in %s on line %d
        !            92: bool(false)
        !            93: bool(false)
        !            94: Done

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