/** * Test for PMA_getHtmlForAddPrefixTable * * @return void */ public function testPMAGetHtmlForAddPrefixTable() { $action = 'delete_row'; $_url_params = array('url_query' => 'PMA_original_url_query'); //Call the test function $html = PMA_getHtmlForAddPrefixTable($action, $_url_params); //form action $this->assertContains('<form id="ajax_form" action="' . $action . '" method="post">', $html); //$_url_params $this->assertContains(URL::getHiddenInputs($_url_params), $html); //from_prefix $this->assertContains(__('Add prefix'), $html); }
include './libraries/tbl_info.inc.php'; } elseif (mb_strlen($db)) { include './libraries/db_common.inc.php'; include './libraries/db_info.inc.php'; } else { include_once './libraries/server_common.inc.php'; } // Builds the query list($full_query, $reload, $full_query_views) = PMA_getQueryFromSelected($what, $db, $table, $selected, $views); // Displays the confirmation form $_url_params = PMA_getUrlParams($what, $reload, $action, $db, $table, $selected, $views, isset($original_sql_query) ? $original_sql_query : null, isset($original_url_query) ? $original_url_query : null); $response = PMA_Response::getInstance(); if ($what == 'replace_prefix_tbl' || $what == 'copy_tbl_change_prefix') { $response->addHTML(PMA_getHtmlForReplacePrefixTable($what, $action, $_url_params)); } elseif ($what == 'add_prefix_tbl') { $response->addHTML(PMA_getHtmlForAddPrefixTable($action, $_url_params)); } else { $response->addHTML(PMA_getHtmlForOtherActions($what, $action, $_url_params, $full_query)); } exit; } elseif (!empty($mult_btn) && $mult_btn == __('Yes')) { /** * Executes the query - dropping rows, columns/fields, tables or dbs */ if ($query_type == 'drop_db' || $query_type == 'drop_tbl' || $query_type == 'drop_fld') { include_once './libraries/relation_cleanup.lib.php'; } if ($query_type == 'primary_fld') { // Gets table primary key $GLOBALS['dbi']->selectDb($db); $result = $GLOBALS['dbi']->query('SHOW KEYS FROM ' . PMA_Util::backquote($table) . ';');
/** * Test for PMA_getHtmlForAddPrefixTable * * @return void */ public function testPMAGetHtmlForAddPrefixTable() { $action = 'delete_row'; $_url_params = array('url_query' => 'PMA_original_url_query'); //Call the test function $html = PMA_getHtmlForAddPrefixTable($action, $_url_params); //validate 1: form action $this->assertContains('<form action="' . $action . '" method="post">', $html); //validate 2: $_url_params $this->assertContains(PMA_URL_getHiddenInputs($_url_params), $html); //validate 3: title $this->assertContains('<legend>' . __('Add table prefix:') . '</legend>', $html); //validate 4: from_prefix $this->assertContains(__('Add prefix'), $html); //validate 5: Submit $this->assertContains(__('Submit'), $html); }
$url_query .= '&goto=tbl_sql.php&back=tbl_sql.php'; include './libraries/tbl_info.inc.php'; } elseif (mb_strlen($db)) { include './libraries/db_common.inc.php'; include './libraries/db_info.inc.php'; } else { include_once './libraries/server_common.inc.php'; } // Builds the query list($full_query, $reload, $full_query_views) = PMA_getQueryFromSelected($what, $db, $table, $selected, $views); // Displays the confirmation form $_url_params = PMA_getUrlParams($what, $reload, $action, $db, $table, $selected, $views, isset($original_sql_query) ? $original_sql_query : null, isset($original_url_query) ? $original_url_query : null); if ($what == 'replace_prefix_tbl' || $what == 'copy_tbl_change_prefix') { echo PMA_getHtmlForReplacePrefixTable($what, $action, $_url_params); } elseif ($what == 'add_prefix_tbl') { echo PMA_getHtmlForAddPrefixTable($action, $_url_params); } else { echo PMA_getHtmlForOtherActions($what, $action, $_url_params, $full_query); } exit; } elseif (!empty($mult_btn) && $mult_btn == __('Yes')) { /** * Executes the query - dropping rows, columns/fields, tables or dbs */ if ($query_type == 'drop_db' || $query_type == 'drop_tbl' || $query_type == 'drop_fld') { include_once './libraries/relation_cleanup.lib.php'; } if ($query_type == 'primary_fld') { // Gets table primary key $GLOBALS['dbi']->selectDb($db); $result = $GLOBALS['dbi']->query('SHOW KEYS FROM ' . PMA_Util::backquote($table) . ';');