getMockBuilder('PMA\libraries\Config') ->disableOriginalConstructor() ->getMock(); $pmaconfig->expects($this->any()) ->method('getUserValue') ->will($this->returnValue('user value for test')); $GLOBALS['PMA_Config'] = $pmaconfig; } /** * Test for PMA_getHtmlForHiddenInput * * @return void */ public function testPMAGetHtmlForHiddenInput() { $export_type = "server"; $db = "PMA"; $table = "PMA_test"; $single_table_str = "PMA_single_str"; $sql_query_str = "sql_query_str"; //Call the test function $html = PMA_getHtmlForHiddenInput( $export_type, $db, $table, $single_table_str, $sql_query_str ); //validate 1: PMA_URL_getHiddenInputs //$single_table $this->assertContains( 'assertContains( 'assertContains( 'cacheTableContent(array($db, $table, 'ENGINE'), 'MERGE'); $columns_info = array( 'test_column1' => array( 'COLUMN_NAME' => 'test_column1' ), 'test_column2' => array( 'COLUMN_NAME' => 'test_column2' ) ); $dbi = $this->getMockBuilder('PMA\libraries\DatabaseInterface') ->disableOriginalConstructor() ->getMock(); $dbi->expects($this->any())->method('getColumnsFull') ->will($this->returnValue($columns_info)); $GLOBALS['dbi'] = $dbi; /* Scan for plugins */ $export_list = PMA_getPlugins( "export", 'libraries/plugins/export/', array( 'export_type' => $export_type, 'single_table' => isset($single_table) ) ); //Call the test function $html = PMA_getHtmlForExportOptions( $export_type, $db, $table, $multi_values_str, $num_tables_str, $export_list, $unlim_num_rows_str ); //validate 2: PMA_getHtmlForExportOptionsMethod $this->assertContains( $cfg['Export']['method'], $html ); $this->assertContains( '