Annotation of embedaddon/php/ext/mysql/tests/mysql_get_server_info.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: mysql_get_server_info()
        !             3: --SKIPIF--
        !             4: <?php
        !             5: require_once('skipif.inc');
        !             6: require_once('skipifconnectfailure.inc');
        !             7: ?>
        !             8: --FILE--
        !             9: <?php
        !            10: include "connect.inc";
        !            11: 
        !            12: if (null !== ($tmp = @mysql_get_server_info(NULL)))
        !            13:        printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
        !            14: 
        !            15: require "table.inc";
        !            16: if (!is_string($info = mysql_get_server_info($link)) || ('' === $info))
        !            17:        printf("[003] Expecting string/any_non_empty, got %s/%s\n", gettype($info), $info);
        !            18: 
        !            19: $def_info = mysql_get_server_info();
        !            20: if ($def_info !== $info) {
        !            21:        printf("[004] Server info for the default link and the specified link differ, [%d] %s\n",
        !            22:                mysql_errno(), mysql_error());
        !            23: 
        !            24:        var_dump($def_info);
        !            25:        var_dump($info);
        !            26: }
        !            27: 
        !            28: if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($info)) {
        !            29:        printf("[005] Expecting Unicode error message!\n");
        !            30:        var_inspect($info);
        !            31: }
        !            32: 
        !            33: if (NULL !== ($tmp = @mysql_get_server_info('too many', 'just too many')))
        !            34:        printf("[006] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
        !            35: 
        !            36: print "done!";
        !            37: ?>
        !            38: --EXPECTF--
        !            39: done!

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