Annotation of embedaddon/php/ext/mysqli/tests/mysqli_phpinfo.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: phpinfo() mysqli section
                      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:        include("connect.inc");
                     12: 
                     13:        @ob_clean();
                     14:        ob_start();
                     15:        phpinfo();
                     16:        $phpinfo = ob_get_contents();
                     17:        ob_end_clean();
                     18: 
                     19:        /* all versions should at least dump this minimum information */
                     20:        if (!stristr($phpinfo, "mysqli support"))
                     21:                printf("[001] ext/mysqli should have exposed itself.\n");
                     22: 
                     23:        if (!stristr($phpinfo, "client api library version"))
                     24:                printf("[002] ext/mysqli should have exposed the library version.\n");
                     25: 
                     26:        if (!stristr($phpinfo, "mysqli.default_host"))
                     27:                printf("[003] php.ini setting mysqli.default_host not shown.\n");
                     28: 
                     29:        if (!stristr($phpinfo, "mysqli.default_port"))
                     30:                printf("[004] php.ini setting mysqli.default_port not shown.\n");
                     31: 
                     32:        if (!stristr($phpinfo, "mysqli.default_pw"))
                     33:                printf("[005] php.ini setting mysqli.default_pw not shown.\n");
                     34: 
                     35:        if (!stristr($phpinfo, "mysqli.default_socket"))
                     36:                printf("[006] php.ini setting mysqli.default_socket not shown.\n");
                     37: 
                     38:        if (!stristr($phpinfo, "mysqli.default_user"))
                     39:                printf("[007] php.ini setting mysqli.default_user not shown.\n");
                     40: 
                     41:        if (!stristr($phpinfo, "mysqli.max_links"))
                     42:                printf("[008] php.ini setting mysqli.max_links not shown.\n");
                     43: 
                     44:        if (!stristr($phpinfo, "mysqli.reconnect"))
                     45:                printf("[009] php.ini setting mysqli.reconnect not shown.\n");
                     46: 
                     47:        if ($IS_MYSQLND) {
                     48:                $expected = array(
1.1.1.2 ! misho      49:                        'mysqlnd statistics',
1.1       misho      50:                        'bytes_sent', 'bytes_received', 'packets_sent', 'packets_received',
                     51:                        'protocol_overhead_in', 'protocol_overhead_out', 'result_set_queries',
                     52:                        'non_result_set_queries', 'no_index_used', 'bad_index_used',
                     53:                        'buffered_sets', 'unbuffered_sets', 'ps_buffered_sets', 'ps_unbuffered_sets',
                     54:                        'flushed_normal_sets', 'flushed_ps_sets', 'rows_fetched_from_server',
                     55:                        'rows_fetched_from_client', 'rows_skipped', 'copy_on_write_saved',
                     56:                        'copy_on_write_performed', 'command_buffer_too_small', 'connect_success',
                     57:                        'connect_failure', 'connection_reused', 'explicit_close', 'implicit_close',
                     58:                        'disconnect_close', 'in_middle_of_command_close', 'explicit_free_result',
                     59:                        'implicit_free_result', 'explicit_stmt_close', 'implicit_stmt_close',
                     60:                        'size',
                     61:                        'mysqli.allow_local_infile',
                     62:                        'mysqli.allow_persistent', 'mysqli.max_persistent'
                     63:                );
                     64:                foreach ($expected as $k => $entry)
                     65:                        if (!stristr($phpinfo, $entry))
                     66:                                printf("[010] Could not find entry for '%s'\n", $entry);
                     67:        }
                     68: 
                     69:        print "done!";
                     70: ?>
                     71: --EXPECTF--
                     72: done!

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