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

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

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