/**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     $_REQUEST['mr_adduser'] = "******";
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['DBG']['sql'] = false;
     $GLOBALS['cfg']['ShowHint'] = true;
     $GLOBALS['table'] = "table";
     $GLOBALS['url_params'] = array();
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $slave_host = array(array('Server_id' => 'Server_id1', 'Host' => 'Host1'), array('Server_id' => 'Server_id2', 'Host' => 'Host2'));
     $fetchResult = array(array("SHOW SLAVE HOSTS", null, null, null, 0, $slave_host));
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValueMap($fetchResult));
     $fields_info = array("Host" => array("Field" => "host", "Type" => "char(60)", "Null" => "NO"));
     $dbi->expects($this->any())->method('getColumns')->will($this->returnValue($fields_info));
     $GLOBALS['dbi'] = $dbi;
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  * @return void
  */
 protected function setUp()
 {
     $this->object = new PMA\libraries\ErrorHandler();
     $GLOBALS['pmaThemeImage'] = 'image';
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
 }
 /**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['server'] = 1;
     $GLOBALS['cfg']['Server']['DisableIS'] = false;
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     $table = $this->getMockBuilder('PMA\\libraries\\Table')->disableOriginalConstructor()->getMock();
     // Expect the table will have 6 rows
     $table->expects($this->any())->method('getRealRowCountTable')->will($this->returnValue(6));
     $table->expects($this->any())->method('countRecords')->will($this->returnValue(6));
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->any())->method('getTable')->will($this->returnValue($table));
     $GLOBALS['dbi'] = $dbi;
     $container = Container::getDefaultContainer();
     $container->set('db', 'db');
     $container->set('table', 'table');
     $container->set('dbi', $GLOBALS['dbi']);
     $this->_response = new \PMA\Test\Stubs\Response();
     $container->set('PMA\\libraries\\Response', $this->_response);
     $container->alias('response', 'PMA\\libraries\\Response');
 }
 /**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['server'] = 1;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     Util::cacheSet('profiling_supported', true);
     $binary_log_file_names = array();
     $binary_log_file_names[] = array("Log_name" => "index1", "File_size" => 100);
     $binary_log_file_names[] = array("Log_name" => "index2", "File_size" => 200);
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->once())->method('fetchResult')->will($this->returnValue($binary_log_file_names));
     $container = Container::getDefaultContainer();
     $container->set('dbi', $dbi);
 }
 /**
  * prepares environment for tests
  *
  * @return void
  */
 public function setUp()
 {
     $GLOBALS['PMA_Types'] = new TypesMySQL();
     $GLOBALS['cfg']['Server']['user'] = '******';
     $GLOBALS['cfg']['Server']['DisableIS'] = true;
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ServerDefault'] = "PMA_server";
     $GLOBALS['cfg']['ActionLinksMode'] = 'icons';
     $GLOBALS['pmaThemeImage'] = 'image';
     $GLOBALS['cfg']['CharEditing'] = '';
     $GLOBALS['cfg']['LimitChars'] = 50;
     $GLOBALS['db'] = 'PMA_db';
     $GLOBALS['table'] = 'PMA_table';
     //$_SESSION
     $GLOBALS['server'] = 1;
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     $_SESSION['relation'][1] = array('PMA_VERSION' => PMA_VERSION, 'centralcolumnswork' => true, 'relwork' => 1, 'db' => 'phpmyadmin', 'relation' => 'relation', 'central_columns' => 'pma_central_columns');
     // mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $GLOBALS['dbi'] = $dbi;
     // set some common expectations
     $dbi->expects($this->any())->method('selectDb')->will($this->returnValue(true));
     $dbi->expects($this->any())->method('getColumns')->will($this->returnValue(array("id" => array("Type" => "integer", "Null" => "NO"), "col1" => array("Type" => 'varchar(100)', "Null" => "YES"), "col2" => array("Type" => 'DATETIME', "Null" => "NO"))));
     $dbi->expects($this->any())->method('getColumnNames')->will($this->returnValue(array("id", "col1", "col2")));
     $dbi->expects($this->any())->method('tryQuery')->will($this->returnValue(true));
     $dbi->expects($this->any())->method('getTables')->will($this->returnValue(array("PMA_table", "PMA_table1", "PMA_table2")));
 }
Esempio n. 6
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  * @return void
  */
 protected function setUp()
 {
     $GLOBALS['plugin_param'] = "csv";
     $this->object = new ImportCsv();
     //setting
     $GLOBALS['finished'] = false;
     $GLOBALS['read_limit'] = 100000000;
     $GLOBALS['offset'] = 0;
     $GLOBALS['cfg']['Server']['DisableIS'] = false;
     $GLOBALS['cfg']['ServerDefault'] = 0;
     $GLOBALS['cfg']['AllowUserDropDatabase'] = false;
     $GLOBALS['cfg']['ShowHint'] = true;
     $GLOBALS['import_file'] = 'test/test_data/db_test.csv';
     $GLOBALS['import_text'] = 'ImportCsv_Test';
     $GLOBALS['compression'] = 'none';
     $GLOBALS['read_multiply'] = 10;
     $GLOBALS['import_type'] = 'Xml';
     $GLOBALS['pmaThemeImage'] = 'image';
     $GLOBALS['import_handle'] = @fopen($GLOBALS['import_file'], 'r');
     //separator for csv
     $GLOBALS['csv_terminated'] = "\r";
     $GLOBALS['csv_enclosed'] = '"';
     $GLOBALS['csv_escaped'] = '"';
     $GLOBALS['csv_new_line'] = 'auto';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $GLOBALS['dbi'] = $dbi;
 }
 /**
  * Test for setUp
  *
  * @return void
  */
 public function setUp()
 {
     $GLOBALS['cfg']['Server']['host'] = "localhost";
     $GLOBALS['cfg']['ShowHint'] = true;
     $GLOBALS['cfg']['ActionLinksMode'] = 'icons';
     $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
     $GLOBALS['replication_info']['master']['status'] = true;
     $GLOBALS['replication_info']['slave']['status'] = false;
     $GLOBALS['replication_types'] = array();
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     //this data is needed when ServerStatusData constructs
     $server_status = array("Aborted_clients" => "0", "Aborted_connects" => "0", "Com_delete_multi" => "0", "Com_create_function" => "0", "Com_empty_query" => "0", "Com_execute_sql" => 2, "Com_stmt_execute" => 2);
     $server_variables = array("auto_increment_increment" => "1", "auto_increment_offset" => "1", "automatic_sp_privileges" => "ON", "back_log" => "50", "big_tables" => "OFF");
     $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));
     $dbi->expects($this->at(0))->method('tryQuery')->with('SHOW GLOBAL STATUS')->will($this->returnValue(true));
     $dbi->expects($this->at(1))->method('fetchRow')->will($this->returnValue(array("Aborted_clients", "0")));
     $dbi->expects($this->at(2))->method('fetchRow')->will($this->returnValue(array("Aborted_connects", "0")));
     $dbi->expects($this->at(3))->method('fetchRow')->will($this->returnValue(array("Com_delete_multi", "0")));
     $dbi->expects($this->at(4))->method('fetchRow')->will($this->returnValue(array("Com_create_function", "0")));
     $dbi->expects($this->at(5))->method('fetchRow')->will($this->returnValue(array("Com_empty_query", "0")));
     $dbi->expects($this->at(6))->method('fetchRow')->will($this->returnValue(false));
     $dbi->expects($this->at(7))->method('freeResult');
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValueMap($fetchResult));
     $GLOBALS['dbi'] = $dbi;
     $this->ServerStatusData = new ServerStatusData();
 }
 /**
  * Test for setUp
  *
  * @return void
  */
 public function setUp()
 {
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ExecTimeLimit'] = 300;
     $GLOBALS['cfg']['ServerDefault'] = "PMA_server";
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['ActionLinksMode'] = 'icons';
     $GLOBALS['cfg']['Server']['host'] = "localhost";
     $GLOBALS['cfg']['Server']['user'] = "******";
     $GLOBALS['cfg']['ShowHint'] = true;
     $GLOBALS['cfg']['ActionLinksMode'] = 'icons';
     $GLOBALS['cfg']['ZipDump'] = true;
     $GLOBALS['cfg']['GZipDump'] = false;
     $GLOBALS['cfg']['BZipDump'] = false;
     $GLOBALS['cfg']['Export']['asfile'] = true;
     $GLOBALS['cfg']['Export']['file_template_server'] = "file_template_server";
     $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
     $GLOBALS['PMA_recoding_engine'] = "InnerDB";
     $GLOBALS['server'] = 0;
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     $GLOBALS['db'] = "PMA";
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     $_SESSION['relation'][$GLOBALS['server']] = "";
     $pmaconfig = $this->getMockBuilder('PMA\\libraries\\Config')->disableOriginalConstructor()->getMock();
     $pmaconfig->expects($this->any())->method('getUserValue')->will($this->returnValue('user value for test'));
     $GLOBALS['PMA_Config'] = $pmaconfig;
 }
 /**
  * prepares environment for tests
  *
  * @return void
  */
 public function setUp()
 {
     $GLOBALS['cfg']['LimitChars'] = 50;
     $GLOBALS['PMA_Types'] = new TypesMySQL();
     $GLOBALS['cfg']['ServerDefault'] = "PMA_server";
     $GLOBALS['pmaThemeImage'] = 'image';
     $GLOBALS['cfg']['ShowHint'] = true;
     $GLOBALS['cfg']['CharEditing'] = '';
     $GLOBALS['cfg']['ActionLinksMode'] = 'icons';
     $GLOBALS['db'] = 'PMA_db';
     $GLOBALS['table'] = 'PMA_table';
     $GLOBALS['server'] = 1;
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $GLOBALS['dbi'] = $dbi;
     // set expectations
     $dbi->expects($this->any())->method('selectDb')->will($this->returnValue(true));
     $dbi->expects($this->any())->method('getColumns')->will($this->returnValue(array("id" => array("Type" => "integer"), "col1" => array("Type" => 'varchar(100)'), "col2" => array("Type" => 'DATETIME'))));
     $dbi->expects($this->any())->method('getColumnNames')->will($this->returnValue(array("id", "col1", "col2")));
     $map = array(array('PMA_db', 'PMA_table1', null, array()), array('PMA_db', 'PMA_table', null, array(array('Key_name' => 'PRIMARY', 'Column_name' => 'id'))), array('PMA_db', 'PMA_table2', null, array(array('Key_name' => 'PRIMARY', 'Column_name' => 'id'), array('Key_name' => 'PRIMARY', 'Column_name' => 'col1'))));
     $dbi->expects($this->any())->method('getTableIndexes')->will($this->returnValueMap($map));
     $dbi->expects($this->any())->method('tryQuery')->will($this->returnValue(true));
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValue(array(0)));
 }
 /**
  * Setup for test cases
  *
  * @return void
  */
 public function setup()
 {
     $GLOBALS['server'] = 1;
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $GLOBALS['pmaThemeImage'] = 'theme/';
     $GLOBALS['PMA_PHP_SELF'] = 'index.php';
     $GLOBALS['cfg']['ServerDefault'] = 1;
     $GLOBALS['text_dir'] = 'ltr';
     $GLOBALS['db'] = 'db';
     $GLOBALS['table'] = 'table';
     $GLOBALS['PMA_Types'] = new TypesMySQL();
     $GLOBALS['cfg']['LimitChars'] = 50;
     $GLOBALS['cfg']['LongtextDoubleTextarea'] = false;
     $GLOBALS['cfg']['ShowFieldTypesInDataEditView'] = true;
     $GLOBALS['cfg']['ShowFunctionFields'] = true;
     $GLOBALS['cfg']['ProtectBinary'] = 'blob';
     $GLOBALS['cfg']['MaxSizeForInputField'] = 10;
     $GLOBALS['cfg']['MinSizeForInputField'] = 2;
     $GLOBALS['cfg']['TextareaRows'] = 5;
     $GLOBALS['cfg']['TextareaCols'] = 4;
     $GLOBALS['cfg']['CharTextareaRows'] = 5;
     $GLOBALS['cfg']['CharTextareaCols'] = 6;
     $GLOBALS['cfg']['AllowThirdPartyFraming'] = false;
     $GLOBALS['cfg']['SendErrorReports'] = 'ask';
     $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
     $GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] = true;
     $GLOBALS['cfg']['DefaultTabTable'] = 'browse';
     $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'structure';
     $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'] = '';
     $GLOBALS['cfg']['Confirm'] = true;
     $GLOBALS['cfg']['LoginCookieValidity'] = 1440;
     $GLOBALS['PMA_Config'] = new PMA\libraries\Config();
 }
 /**
  * Test for setUp
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
     $GLOBALS['server'] = 1;
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     //this data is needed when ServerStatusData constructs
     $server_session_variable = array("auto_increment_increment" => "1", "auto_increment_offset" => "13", "automatic_sp_privileges" => "ON", "back_log" => "50", "big_tables" => "OFF");
     $server_global_variables = array("auto_increment_increment" => "0", "auto_increment_offset" => "12");
     $fetchResult = array(array("SHOW SESSION VARIABLES;", 0, 1, null, 0, $server_session_variable), array("SHOW GLOBAL VARIABLES;", 0, 1, null, 0, $server_global_variables));
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValueMap($fetchResult));
     $GLOBALS['dbi'] = $dbi;
     $container = Container::getDefaultContainer();
     $container->set('dbi', $GLOBALS['dbi']);
     $this->_response = new \PMA\Test\Stubs\Response();
     $container->set('PMA\\libraries\\Response', $this->_response);
     $container->alias('response', 'PMA\\libraries\\Response');
 }
 /**
  * Test for setUp
  *
  * @return void
  */
 public function setUp()
 {
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['Server']['DisableIS'] = false;
     $GLOBALS['server'] = 0;
     $GLOBALS['cfg']['ActionLinksMode'] = "both";
     $GLOBALS['pmaThemeImage'] = 'image';
     //_SESSION
     $_SESSION['relation'][$GLOBALS['server']] = array('PMA_VERSION' => PMA_VERSION, 'table_coords' => "table_name", 'displaywork' => 'displaywork', 'db' => "information_schema", 'table_info' => 'table_info', 'relwork' => 'relwork', 'commwork' => 'commwork', 'pdfwork' => 'pdfwork', 'column_info' => 'column_info', 'relation' => 'relation');
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->any())->method('query')->will($this->returnValue(true));
     $GLOBALS['dbi'] = $dbi;
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  * @return void
  */
 protected function setUp()
 {
     $this->object = new PMA\libraries\Error('2', 'Compile Error', 'error.txt', 15);
     $GLOBALS['pmaThemeImage'] = 'image';
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
 }
 /**
  * Test for setUp
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['DBG']['sql'] = false;
     $GLOBALS['cfg']['Server']['host'] = "localhost";
     $GLOBALS['cfg']['ActionLinksMode'] = 'icons';
     $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     //this data is needed when ServerStatusData constructs
     $server_session_variable = array("auto_increment_increment" => "1", "auto_increment_offset" => "13", "automatic_sp_privileges" => "ON", "back_log" => "50", "big_tables" => "OFF");
     $server_global_variables = array("auto_increment_increment" => "0", "auto_increment_offset" => "12");
     $fetchResult = array(array("SHOW SESSION VARIABLES;", 0, 1, null, 0, $server_session_variable), array("SHOW GLOBAL VARIABLES;", 0, 1, null, 0, $server_global_variables));
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValueMap($fetchResult));
     $GLOBALS['dbi'] = $dbi;
 }
 /**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['server'] = 1;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['Server']['DisableIS'] = false;
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     $table = $this->getMockBuilder('PMA\\libraries\\Table')->disableOriginalConstructor()->getMock();
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->any())->method('getTable')->will($this->returnValue($table));
     $GLOBALS['dbi'] = $dbi;
     $container = Container::getDefaultContainer();
     $container->set('db', 'db');
     $container->set('table', 'table');
     $container->set('dbi', $GLOBALS['dbi']);
     $this->response = new \PMA\Test\Stubs\Response();
     $container->set('PMA\\libraries\\Response', $this->response);
     $container->alias('response', 'PMA\\libraries\\Response');
 }
 /**
  * Test for setUp
  *
  * @return void
  */
 public function setUp()
 {
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['DBG']['sql'] = false;
     $GLOBALS['cfg']['Server']['host'] = "localhost";
     $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
     $GLOBALS['replication_info']['master']['status'] = false;
     $GLOBALS['replication_info']['slave']['status'] = false;
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     //this data is needed when ServerStatusData constructs
     $server_status = array("Aborted_clients" => "0", "Aborted_connects" => "0", "Com_delete_multi" => "0", "Com_create_function" => "0", "Com_empty_query" => "0");
     $server_variables = array("auto_increment_increment" => "1", "auto_increment_offset" => "1", "automatic_sp_privileges" => "ON", "back_log" => "50", "big_tables" => "OFF");
     $fetchResult = array(array("SHOW GLOBAL STATUS", 0, 1, null, 0, $server_status), array("SHOW GLOBAL VARIABLES", 0, 1, null, 0, $server_variables));
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValueMap($fetchResult));
     $GLOBALS['dbi'] = $dbi;
     $this->ServerStatusData = new ServerStatusData();
     $upTime = "10h";
     $this->ServerStatusData->status['Uptime'] = $upTime;
     $this->ServerStatusData->used_queries = array("Com_change_db" => "15", "Com_select" => "12", "Com_set_option" => "54", "Com_show_databases" => "16", "Com_show_status" => "14", "Com_show_tables" => "13");
 }
 /**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['PMA_Config'] = new PMA\libraries\Config();
     $GLOBALS['PMA_Config']->enableBc();
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['MaxDbList'] = 100;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['DBG']['sql'] = false;
     $GLOBALS['cfg']['ActionLinksMode'] = "both";
     $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
     $GLOBALS['table'] = "table";
     $GLOBALS['replication_info']['master']['status'] = false;
     $GLOBALS['replication_info']['slave']['status'] = false;
     $GLOBALS['pmaThemeImage'] = 'image';
     $GLOBALS['text_dir'] = "text_dir";
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
 }
 /**
  * Test for setUp
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['Server']['host'] = "localhost";
     $GLOBALS['cfg']['ShowHint'] = true;
     $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
     $GLOBALS['replication_info']['master']['status'] = false;
     $GLOBALS['replication_info']['slave']['status'] = false;
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     //this data is needed when ServerStatusData constructs
     $server_status = array("Aborted_clients" => "0", "Aborted_connects" => "0", "Com_delete_multi" => "0", "Com_create_function" => "0", "Com_empty_query" => "0");
     $server_variables = array("auto_increment_increment" => "1", "auto_increment_offset" => "1", "automatic_sp_privileges" => "ON", "back_log" => "50", "big_tables" => "OFF");
     $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));
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValueMap($fetchResult));
     $GLOBALS['dbi'] = $dbi;
     $this->ServerStatusData = new ServerStatusData();
 }
 /**
  * Set up
  *
  * @return void
  */
 public function setUp()
 {
     //session_start();
     // cleaning constants
     if (PMA_HAS_RUNKIT) {
         $this->oldIISvalue = 'non-defined';
         $defined_constants = get_defined_constants(true);
         $user_defined_constants = $defined_constants['user'];
         if (array_key_exists('PMA_IS_IIS', $user_defined_constants)) {
             $this->oldIISvalue = PMA_IS_IIS;
             runkit_constant_redefine('PMA_IS_IIS', null);
         } else {
             runkit_constant_add('PMA_IS_IIS', null);
         }
         $this->oldSIDvalue = 'non-defined';
         if (array_key_exists('SID', $user_defined_constants)) {
             $this->oldSIDvalue = SID;
             runkit_constant_redefine('SID', null);
         } else {
             runkit_constant_add('SID', null);
         }
     }
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $GLOBALS['server'] = 0;
     $GLOBALS['PMA_Config'] = new PMA\libraries\Config();
     $GLOBALS['PMA_Config']->enableBc();
 }
Esempio n. 20
0
 /**
  * SetUp for test cases
  *
  * @return void
  */
 public function setup()
 {
     $GLOBALS['server'] = 0;
     $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
     $GLOBALS['cfg']['MaxNavigationItems'] = 250;
     $GLOBALS['cfg']['Server'] = array();
     $GLOBALS['cfg']['Server']['DisableIS'] = true;
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
 }
 /**
  * SetUp for test cases
  *
  * @return void
  */
 public function setup()
 {
     $GLOBALS['server'] = 0;
     $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
     $GLOBALS['cfg']['NavigationTreeDbSeparator'] = '_';
     $GLOBALS['cfg']['NavigationTreeTableSeparator'] = '__';
     $GLOBALS['cfg']['NavigationTreeTableLevel'] = 1;
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
 }
Esempio n. 22
0
 /**
  * Set up global environment.
  *
  * @return void
  */
 public function setup()
 {
     $GLOBALS['table'] = 'table';
     $GLOBALS['db'] = 'db';
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $GLOBALS['cfg'] = array('ServerDefault' => 1, 'ActionLinksMode' => 'icons');
     $GLOBALS['cfg']['DBG']['sql'] = false;
     $GLOBALS['server'] = 1;
 }
 /**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     $GLOBALS['cfg']['ServerDefault'] = 1;
     $GLOBALS['cfg']['ActionLinksMode'] = 'both';
     $GLOBALS['server'] = 1;
     $_SESSION['relation'][$GLOBALS['server']] = array('PMA_VERSION' => PMA_VERSION, 'db' => 'pmadb', 'users' => 'users', 'usergroups' => 'usergroups');
     $GLOBALS['pmaThemeImage'] = 'image';
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
 }
Esempio n. 24
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  * @return void
  */
 protected function setUp()
 {
     $GLOBALS['cfg']['Server']['ssl'] = false;
     $GLOBALS['cfg']['Server']['compress'] = true;
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     $this->object = new DBIMysqli();
 }
Esempio n. 25
0
 /**
  * Sets up the fixture.
  *
  * @access protected
  * @return void
  */
 protected function setUp()
 {
     $this->object = new PMA\libraries\navigation\Navigation();
     $GLOBALS['cfgRelation']['db'] = 'pmadb';
     $GLOBALS['cfgRelation']['navigationhiding'] = 'navigationhiding';
     $GLOBALS['cfg']['Server']['user'] = '******';
     $GLOBALS['cfg']['ActionLinksMode'] = 'both';
     $GLOBALS['pmaThemeImage'] = 'image';
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
 }
 /**
  * Configures global environment.
  *
  * @return void
  */
 function setup()
 {
     $GLOBALS['PMA_Config']->enableBc();
     $GLOBALS['server'] = 0;
     $GLOBALS['text_dir'] = 'ltr';
     $GLOBALS['db'] = 'db';
     $GLOBALS['table'] = 'table';
     $this->object = new AuthenticationCookie();
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     $GLOBALS['PMA_PHP_SELF'] = '/phpmyadmin/';
 }
 /**
  * Configures global environment.
  *
  * @return void
  */
 function setup()
 {
     $GLOBALS['PMA_Config']->enableBc();
     $GLOBALS['server'] = 0;
     $GLOBALS['available_languages'] = array("en" => array("English", "US-ENGLISH"), "ch" => array("Chinese", "TW-Chinese"));
     $GLOBALS['text_dir'] = 'ltr';
     $GLOBALS['db'] = 'db';
     $GLOBALS['table'] = 'table';
     $this->object = new AuthenticationCookie();
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
 }
 /**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     //$GLOBALS
     $GLOBALS['table'] = "table";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
 }
Esempio n. 29
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  * @return void
  */
 protected function setUp()
 {
     $GLOBALS['cfg']['Server']['ssl'] = false;
     $GLOBALS['cfg']['PersistentConnections'] = false;
     $GLOBALS['cfg']['Server']['compress'] = true;
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ActionLinksMode'] = "both";
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     $this->object = new DBIMysqli();
 }
 /**
  * SetUp for test cases
  *
  * @return void
  */
 public function setup()
 {
     $GLOBALS['server'] = 0;
     $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'b_browse';
     $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'] = '';
     $GLOBALS['cfg']['DefaultTabTable'] = 'browse';
     $GLOBALS['cfg']['MaxNavigationItems'] = 250;
     $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
     $GLOBALS['cfg']['NavigationTreeDbSeparator'] = '_';
     $GLOBALS['cfg']['NavigationTreeTableSeparator'] = '__';
     $GLOBALS['cfg']['NavigationTreeTableLevel'] = 1;
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
 }