/** * Test for PMA_getHtmlForCopyDatabase * * @return void */ public function testGetHtmlForCopyDatabase() { $_REQUEST['db_collation'] = 'db1'; $html = PMA_getHtmlForCopyDatabase("pma"); $this->assertRegExp('/.*db_operations.php.*/', $html); $this->assertRegExp('/.*db_copy.*/', $html); $this->assertRegExp('/.*Copy database to.*/', $html); }
* rename database */ if ($GLOBALS['db'] != 'mysql') { $response->addHTML(PMA_getHtmlForRenameDatabase($GLOBALS['db'])); } // Drop link if allowed // Don't even try to drop information_schema. // You won't be able to. Believe me. You won't. // Don't allow to easily drop mysql database, RFE #1327514. if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && !$db_is_system_schema && $GLOBALS['db'] != 'mysql') { $response->addHTML(PMA_getHtmlForDropDatabaseLink($GLOBALS['db'])); } /** * Copy database */ $response->addHTML(PMA_getHtmlForCopyDatabase($GLOBALS['db'])); /** * Change database charset */ $response->addHTML(PMA_getHtmlForChangeDatabaseCharset($GLOBALS['db'], $table)); if (!$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { $message = PMA\libraries\Message::notice(__('The phpMyAdmin configuration storage has been deactivated. ' . '%sFind out why%s.')); $message->addParam('<a href="' . './chk_rel.php' . $url_query . '">', false); $message->addParam('</a>', false); /* Show error if user has configured something, notice elsewhere */ if (!empty($cfg['Servers'][$server]['pmadb'])) { $message->isError(true); } } // end if }
* rename database */ if ($db != 'mysql') { $response->addHTML(PMA_getHtmlForRenameDatabase($db)); } // Drop link if allowed // Don't even try to drop information_schema. // You won't be able to. Believe me. You won't. // Don't allow to easily drop mysql database, RFE #1327514. if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && !$db_is_system_schema && (PMA_DRIZZLE || $db != 'mysql')) { $response->addHTML(PMA_getHtmlForDropDatabaseLink($db)); } /** * Copy database */ $response->addHTML(PMA_getHtmlForCopyDatabase($db)); /** * Change database charset */ $response->addHTML(PMA_getHtmlForChangeDatabaseCharset($db, $table)); if ($num_tables > 0 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { $message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.')); $message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false); $message->addParam('</a>', false); /* Show error if user has configured something, notice elsewhere */ if (!empty($cfg['Servers'][$server]['pmadb'])) { $message->isError(true); } $response->addHTML('<div class="operations_full_width">'); $response->addHTML($message->getDisplay()); $response->addHTML('</div>');
/** * Test for PMA_getHtmlForCopyDatabase * * @return void */ public function testGetHtmlForCopyDatabase() { $_REQUEST['db_collation'] = 'db1'; $this->assertRegExp('/.*db_operations.php(.|[\\n])*db_copy([\\n]|.)*Copy database to.*/m', PMA_getHtmlForCopyDatabase("pma")); }