diff --git a/libraries/ServerStatusData.class.php b/libraries/ServerStatusData.class.php index 18676bf42a..47c8c0d3a2 100644 --- a/libraries/ServerStatusData.class.php +++ b/libraries/ServerStatusData.class.php @@ -62,8 +62,8 @@ class PMA_ServerStatusData $server_status = $GLOBALS['dbi']->fetchResult('SHOW GLOBAL STATUS', 0, 1); if (PMA_DRIZZLE) { // Drizzle doesn't put query statistics into variables, add it - $sql = "SELECT concat('Com_', variable_name), variable_value - FROM data_dictionary.GLOBAL_STATEMENTS"; + $sql = "SELECT concat('Com_', variable_name), variable_value " + . "FROM data_dictionary.GLOBAL_STATEMENTS"; $statements = $GLOBALS['dbi']->fetchResult($sql, 0, 1); $server_status = array_merge($server_status, $statements); } diff --git a/test/libraries/PMA_server_status_monitor_test.php b/test/libraries/PMA_server_status_monitor_test.php index 1edd2f9d3a..7446fbb123 100644 --- a/test/libraries/PMA_server_status_monitor_test.php +++ b/test/libraries/PMA_server_status_monitor_test.php @@ -95,14 +95,36 @@ class PMA_ServerStatusMonitor_Test extends PHPUnit_Framework_TestCase "big_tables" => "OFF", ); - $dbi->expects($this->at(0))->method('fetchResult') - ->with('SHOW GLOBAL STATUS', 0, 1) - ->will($this->returnValue($server_status)); + $fetchResult = array( + array( + "SHOW GLOBAL STATUS", + 0, + 1, + null, + 0, + $server_status + ), + array( + "SHOW GLOBAL VARIABLES", + 0, + 1, + null, + 0, + $server_variables + ), + array( + "SELECT concat('Com_', variable_name), variable_value " + . "FROM data_dictionary.GLOBAL_STATEMENTS", + 0, + 1, + null, + 0, + $server_status + ), + ); - $server_variables = array(); - $dbi->expects($this->at(1))->method('fetchResult') - ->with('SHOW GLOBAL VARIABLES', 0, 1) - ->will($this->returnValue($server_variables)); + $dbi->expects($this->any())->method('fetchResult') + ->will($this->returnValueMap($fetchResult)); $GLOBALS['dbi'] = $dbi; @@ -157,13 +179,9 @@ class PMA_ServerStatusMonitor_Test extends PHPUnit_Framework_TestCase $this->assertContains( __('Monitor Instructions'), $html - ); + ); $this->assertContains( - 'Instructions/Setup', - $html - ); - $this->assertContains( - 'Settings', + 'monitorInstructionsDialog', $html ); //validate 4: PMA_getHtmlForAddChartDialog diff --git a/test/libraries/PMA_server_status_variables_test.php b/test/libraries/PMA_server_status_variables_test.php index 64f09a5cd9..88168d1ed6 100644 --- a/test/libraries/PMA_server_status_variables_test.php +++ b/test/libraries/PMA_server_status_variables_test.php @@ -94,14 +94,36 @@ class PMA_ServerStatusVariables_Test extends PHPUnit_Framework_TestCase "big_tables" => "OFF", ); - $dbi->expects($this->at(0))->method('fetchResult') - ->with('SHOW GLOBAL STATUS', 0, 1) - ->will($this->returnValue($server_status)); + $fetchResult = array( + array( + "SHOW GLOBAL STATUS", + 0, + 1, + null, + 0, + $server_status + ), + array( + "SHOW GLOBAL VARIABLES", + 0, + 1, + null, + 0, + $server_variables + ), + array( + "SELECT concat('Com_', variable_name), variable_value " + . "FROM data_dictionary.GLOBAL_STATEMENTS", + 0, + 1, + null, + 0, + $server_status + ), + ); - $server_variables = array(); - $dbi->expects($this->at(1))->method('fetchResult') - ->with('SHOW GLOBAL VARIABLES', 0, 1) - ->will($this->returnValue($server_variables)); + $dbi->expects($this->any())->method('fetchResult') + ->will($this->returnValueMap($fetchResult)); $GLOBALS['dbi'] = $dbi; $this->ServerStatusData = new PMA_ServerStatusData();