/** * Test for PMA_getTableColumns * * @return void */ public function testGetTableColumns() { $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock(); $dbi->expects($this->at(0))->method('selectDb')->with('db'); $dbi->expects($this->at(1))->method('getColumns')->with('db', 'table')->will($this->returnValue(array('a' => 'b', 'c' => 'd'))); $GLOBALS['dbi'] = $dbi; $result = PMA_getTableColumns('db', 'table'); $this->assertEquals(array('b', 'd'), $result); }
$scripts->addFile('sql.js'); $scripts->addFile('tbl_change.js'); $scripts->addFile('big_ints.js'); $scripts->addFile('jquery/jquery-ui-timepicker-addon.js'); $scripts->addFile('jquery/jquery.validate.js'); $scripts->addFile('jquery/additional-methods.js'); $scripts->addFile('gis_data_editor.js'); /** * Displays the query submitted and its result * * $disp_message come from tbl_replace.php */ if (!empty($disp_message)) { $response->addHTML(Util::getMessage($disp_message, null)); } $table_columns = PMA_getTableColumns($db, $table); // retrieve keys into foreign fields, if any $foreigners = PMA_getForeigners($db, $table); // Retrieve form parameters for insert/edit form $_form_params = PMA_getFormParametersForInsertForm($db, $table, $where_clauses, $where_clause_array, $err_url); /** * Displays the form */ // autocomplete feature of IE kills the "onchange" event handler and it // must be replaced by the "onpropertychange" one in this case $chg_evt_handler = 'onchange'; // Had to put the URI because when hosted on an https server, // some browsers send wrongly this form to the http server. $html_output = ''; // Set if we passed the first timestamp field $timestamp_seen = false;