public/phpmyadmin/test/classes/Server/Status/QueriesTest.php
/**
     * Test for Queries::getHtmlForQueryStatistics
     *
     * @return void
     */
Test for Queries::getHtmlForQueryStatistics
@return void
Test for Queries :: getHtmlForQueryStatistics @return void
public function testPMAGetHtmlForQueryStatistics()
    {
        $html = Queries::getHtmlForQueryStatistics($this->serverStatusData);
        $hour_factor   = 3600 / $this->serverStatusData->status['Uptime'];
        $used_queries = $this->serverStatusData->used_queries;
        $total_queries = array_sum($used_queries);
        $questions_from_start = sprintf(
            __('Questions since startup: %s'),
            Util::formatNumber($total_queries, 0)
        );
        $this->assertContains(
            '<h3 id="serverstatusqueries">',
            $html
        );
        $this->assertContains(
            $questions_from_start,
            $html
        );
        $this->assertContains(
            __('per hour:'),
            $html
        );
        $this->assertContains(
            Util::formatNumber($total_queries * $hour_factor, 0),
            $html
        );
        $value_per_minute = Util::formatNumber(
            $total_queries * 60 / $this->serverStatusData->status['Uptime'],
            0
        );
        $this->assertContains(
            __('per minute:'),
            $html
        );
        $this->assertContains(
            $value_per_minute,
            $html
        );
    }
public function testPMAGetHtmlForQueryStatistics ( ) { $ html = Queries :: getHtmlForQueryStatistics ( $ this -> serverStatusData ) ; $ hour_factor = 3600 / $ this -> serverStatusData -> status [ 'Uptime' ] ; $ used_queries = $ this -> serverStatusData -> used_queries ; $ total_queries = array_sum ( $ used_queries ) ; $ questions_from_start = sprintf ( __ ( 'Questions since startup: %s' ) , Util :: formatNumber ( $ total_queries , 0 ) ) ; $ this -> assertContains ( '<h3 id="serverstatusqueries">' , $ html ) ; $ this -> assertContains ( $ questions_from_start , $ html ) ; $ this -> assertContains ( __ ( 'per hour:' ) , $ html ) ; $ this -> assertContains ( Util :: formatNumber ( $ total_queries * $ hour_factor , 0 ) , $ html ) ; $ value_per_minute = Util :: formatNumber ( $ total_queries * 60 / $ this -> serverStatusData -> status [ 'Uptime' ] , 0 ) ; $ this -> assertContains ( __ ( 'per minute:' ) , $ html ) ; $ this -> assertContains ( $ value_per_minute , $ html ) ; }
Test for Queries::getHtmlForQueryStatistics
 @return void
Test for Queries :: getHtmlForQueryStatistics @return void
//Call the test function //validate 1: Queries::getHtmlForQueryStatistics //validate 2: per hour //validate 3:per minute