/** * Test for PMA_getHtmlForTableConfigurations * * @return void */ public function testGetHtmlForTableConfigurations() { $_REQUEST['comment'] = 'c&d'; $_REQUEST['tbl_storage_engine'] = 'engine'; $_REQUEST['tbl_collation'] = 'latin1_swedish_ci'; $_REQUEST['partition_definition'] = "partition>"; $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock(); $dbi->expects($this->any())->method('fetchResult')->will($this->returnValue(array(array('Name' => 'partition', 'Support' => 'NO')))); $GLOBALS['dbi'] = $dbi; $result = PMA_getHtmlForTableConfigurations(); $this->assertContains('<input type="text" name="comment" size="40" maxlength="2048" ' . 'value="c&d" class="textfield"', $result); $this->assertContains('<select name="tbl_storage_engine">', $result); $this->assertContains('<select lang="en" dir="ltr" name="tbl_collation">', $result); $this->assertContains('<option value="utf8_bin" title="Unicode (multilingual), Binary">' . 'utf8_bin</option>', $result); $this->assertContains('<textarea name="partition_definition" id="partitiondefinition" ' . 'cols="10" rows="15" dir="text_dir">partition></textarea>', $result); }
/** * Function to get html for the create table or field add view * * @param string $action action * @param array $form_params forms parameters * @param array $content_cells content cells * @param array $header_cells header cells * * @return string */ function PMA_getHtmlForTableCreateOrAddField($action, $form_params, $content_cells, $header_cells) { $html = '<form method="post" action="' . $action . '" class="' . ($action == 'tbl_create.php' ? 'create_table' : 'append_fields') . '_form ajax lock-page">'; $html .= PMA_URL_getHiddenInputs($form_params); $html .= '<input type="hidden" name="primary_indexes" value="[]">'; $html .= '<input type="hidden" name="unique_indexes" value="[]">'; $html .= '<input type="hidden" name="indexes" value="[]">'; $html .= '<input type="hidden" name="fulltext_indexes" value="[]">'; if ($action == 'tbl_create.php') { $html .= PMA_getHtmlForTableNameAndNoOfColumns(); } if (is_array($content_cells) && is_array($header_cells)) { $html .= PMA_getHtmlForTableFieldDefinitions($header_cells, $content_cells); } if ($action == 'tbl_create.php') { $html .= PMA_getHtmlForTableConfigurations(); } $html .= PMA_getHtmlForFooter(); return $html; }
/** * Function to get html for the create table or field add view * * @param string $action action * @param array $form_params forms parameters * @param array $content_cells content cells * @param array $header_cells header cells * * @return string */ function PMA_getHtmlForTableCreateOrAddField($action, $form_params, $content_cells, $header_cells) { $html = '<form method="post" action="' . $action . '" class="' . ($action == 'tbl_create.php' ? 'create_table' : 'append_fields') . '_form ajax">'; $html .= PMA_URL_getHiddenInputs($form_params); if ($action == 'tbl_create.php') { $html .= PMA_getHtmlForTableNameAndNoOfColumns(); } if (is_array($content_cells) && is_array($header_cells)) { $html .= PMA_getHtmlForTableFieldDefinitions($header_cells, $content_cells); } if ($action == 'tbl_create.php') { $html .= PMA_getHtmlForTableConfigurations(); } $html .= PMA_getHtmlForFooter(); return $html; }