public/phpmyadmin/test/classes/Server/Status/MonitorTest.php
/**
     * Test for Monitor::getJsonForLoggingVars
     *
     * @return void
     */
Test for Monitor::getJsonForLoggingVars
@return void
Test for Monitor :: getJsonForLoggingVars @return void
public function testPMAGetJsonForLoggingVars()
    {
        $_POST['varName'] = "varName";
        $dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface')
            ->disableOriginalConstructor()
            ->getMock();
        $value = array(
            'sql_text' => 'insert sql_text',
            '#' => 22,
            'argument' => 'argument argument2',
        );
        $dbi->expects($this->any())->method('fetchResult')
            ->will($this->returnValue($value));
        $GLOBALS['dbi'] = $dbi;
        $ret = Monitor::getJsonForLoggingVars();
        $this->assertEquals(
            $value,
            $ret
        );
    }
public function testPMAGetJsonForLoggingVars ( ) { $ _POST [ 'varName' ] = " varName " ; $ dbi = $ this -> getMockBuilder ( 'PhpMyAdmin\DatabaseInterface' ) -> disableOriginalConstructor ( ) -> getMock ( ) ; $ value = array ( 'sql_text' => 'insert sql_text' , '#' => 22 , 'argument' => 'argument argument2' , ) ; $ dbi -> expects ( $ this -> any ( ) ) -> method ( 'fetchResult' ) -> will ( $ this -> returnValue ( $ value ) ) ; $ GLOBALS [ 'dbi' ] = $ dbi ; $ ret = Monitor :: getJsonForLoggingVars ( ) ; $ this -> assertEquals ( $ value , $ ret ) ; }
Test for Monitor::getJsonForLoggingVars
 @return void
Test for Monitor :: getJsonForLoggingVars @return void
//Mock DBI //Call the test function //validate that, the result is the same as fetchResult