enableBc(); $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $GLOBALS['cfg']['Server']['DisableIS'] = false; $GLOBALS['cfg']['Server']['host'] = 'localhost'; $GLOBALS['replication_info']['master']['status'] = true; $GLOBALS['replication_info']['slave']['status'] = true; $GLOBALS['replication_types'] = []; $serverStatus = [ 'Aborted_clients' => '0', 'Aborted_connects' => '0', 'Com_delete_multi' => '0', 'Com_create_function' => '0', 'Com_empty_query' => '0', ]; $serverVariables = [ 'auto_increment_increment' => '1', 'auto_increment_offset' => '1', 'automatic_sp_privileges' => 'ON', 'back_log' => '50', 'big_tables' => 'OFF', ]; $fetchResult = [ [ 'SHOW GLOBAL STATUS', 0, 1, DatabaseInterface::CONNECT_USER, 0, $serverStatus, ], [ 'SHOW GLOBAL VARIABLES', 0, 1, DatabaseInterface::CONNECT_USER, 0, $serverVariables, ], [ "SELECT concat('Com_', variable_name), variable_value " . 'FROM data_dictionary.GLOBAL_STATEMENTS', 0, 1, DatabaseInterface::CONNECT_USER, 0, $serverStatus, ], ]; $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() ->getMock(); $dbi->expects($this->any())->method('fetchResult') ->will($this->returnValueMap($fetchResult)); $GLOBALS['dbi'] = $dbi; $this->data = new Data(); } public function testIndex(): void { $controller = new ProcessesController( Response::getInstance(), $GLOBALS['dbi'], new Template(), $this->data ); $html = $controller->index([ 'showExecuting' => null, 'full' => null, 'column_name' => null, 'order_by_field' => null, 'sort_order' => null, ]); $this->assertStringContainsString( 'Note: Enabling the auto refresh here might cause ' . 'heavy traffic between the web server and the MySQL server.', $html ); // Test tab links $this->assertStringContainsString( '