Annotation of embedaddon/php/ext/mysqli/tests/mysqli_dump_debug_info.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: mysqli_dump_debug_info()
        !             3: --SKIPIF--
        !             4: <?php
        !             5: require_once('skipif.inc');
        !             6: require_once('skipifemb.inc');
        !             7: require_once('skipifconnectfailure.inc');
        !             8: ?>
        !             9: --FILE--
        !            10: <?php
        !            11:        require_once("connect.inc");
        !            12: 
        !            13:        $tmp    = NULL;
        !            14:        $link   = NULL;
        !            15: 
        !            16:        if (NULL !== ($tmp = @mysqli_dump_debug_info()))
        !            17:                printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
        !            18: 
        !            19:        if (NULL !== ($tmp = @mysqli_dump_debug_info($link)))
        !            20:                printf("[002] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
        !            21: 
        !            22:        if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
        !            23:                printf("[003] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
        !            24:                        $host, $user, $db, $port, $socket);
        !            25:                exit(1);
        !            26:        }
        !            27: 
        !            28:        if (!is_bool($tmp = mysqli_dump_debug_info($link)))
        !            29:                printf("[004] Expecting boolean/[true|false] value, got %s/%s, [%d] %s\n",
        !            30:                        gettype($tmp), $tmp,
        !            31:                        mysqli_errno($link), mysqli_error($link));
        !            32: 
        !            33:        mysqli_close($link);
        !            34: 
        !            35:        if (NULL !== ($tmp = mysqli_dump_debug_info($link)))
        !            36:                printf("[005] Expecting NULL, got %s/%s\n",
        !            37:                        gettype($tmp), $tmp,
        !            38:                        mysqli_errno($link), mysqli_error($link));
        !            39: 
        !            40:        print "done!";
        !            41: ?>
        !            42: --EXPECTF--
        !            43: Warning: mysqli_dump_debug_info(): Couldn't fetch mysqli in %s on line %d
        !            44: done!

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