diff --git a/db_designer.php b/db_designer.php index 269b4bef9c..d199fdf1a1 100644 --- a/db_designer.php +++ b/db_designer.php @@ -5,25 +5,25 @@ * * @package PhpMyAdmin-Designer */ +use PhpMyAdmin\Database\Designer; use PhpMyAdmin\Response; require_once 'libraries/common.inc.php'; require_once 'libraries/pmd_common.php'; -require_once 'libraries/db_designer.lib.php'; $response = Response::getInstance(); if (isset($_REQUEST['dialog'])) { if ($_REQUEST['dialog'] == 'edit') { - $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage'); + $html = Designer::getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage'); } else if ($_REQUEST['dialog'] == 'delete') { - $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage'); + $html = Designer::getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage'); } else if ($_REQUEST['dialog'] == 'save_as') { - $html = PMA_getHtmlForPageSaveAs($GLOBALS['db']); + $html = Designer::getHtmlForPageSaveAs($GLOBALS['db']); } else if ($_REQUEST['dialog'] == 'export') { include_once 'libraries/plugin_interface.lib.php'; - $html = PMA_getHtmlForSchemaExport( + $html = Designer::getHtmlForSchemaExport( $GLOBALS['db'], $_REQUEST['selected_page'] ); } else if ($_REQUEST['dialog'] == 'add_table') { @@ -42,7 +42,7 @@ if (isset($_REQUEST['dialog'])) { $GLOBALS['PMD']['TABLE_TYPE'] = array($GLOBALS['PMD_URL']['TABLE_TYPE'][$req_key]); $GLOBALS['PMD_OUT']['OWNER'] = array($GLOBALS['PMD_OUT']['OWNER'][$req_key]); - $html = PMA_getDatabaseTables( + $html = Designer::getDatabaseTables( array(), -1, $tab_column, $tables_all_keys, $tables_pk_or_unique_keys ); @@ -111,7 +111,7 @@ $tab_column = PMA_getColumnsInfo(); $script_tables = PMA_getScriptTabs(); $tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys(); $tables_all_keys = PMA_getAllKeys(); -$classes_side_menu = PMA_returnClassNamesFromMenuButtons(); +$classes_side_menu = Designer::returnClassNamesFromMenuButtons(); $display_page = -1; $selected_page = null; @@ -165,12 +165,12 @@ list( // Embed some data into HTML, later it will be read // by pmd/init.js and converted to JS variables. $response->addHTML( - PMA_getHtmlForJSFields( + Designer::getHtmlForJsFields( $script_tables, $script_contr, $script_display_field, $display_page ) ); $response->addHTML( - PMA_getDesignerPageMenu( + Designer::getPageMenu( isset($_REQUEST['query']), $selected_page, $classes_side_menu @@ -184,11 +184,11 @@ $response->addHTML( '
' ); -$response->addHTML(PMA_getHTMLCanvas()); -$response->addHTML(PMA_getHTMLTableList($tab_pos, $display_page)); +$response->addHTML(Designer::getHtmlCanvas()); +$response->addHTML(Designer::getHtmlTableList($tab_pos, $display_page)); $response->addHTML( - PMA_getDatabaseTables( + Designer::getDatabaseTables( $tab_pos, $display_page, $tab_column, $tables_all_keys, $tables_pk_or_unique_keys ) @@ -198,16 +198,16 @@ $response->addHTML(''); // end canvas_outer $response->addHTML('
'); -$response->addHTML(PMA_getNewRelationPanel()); -$response->addHTML(PMA_getDeleteRelationPanel()); +$response->addHTML(Designer::getNewRelationPanel()); +$response->addHTML(Designer::getDeleteRelationPanel()); if (isset($_REQUEST['query'])) { - $response->addHTML(PMA_getOptionsPanel()); - $response->addHTML(PMA_getRenameToPanel()); - $response->addHTML(PMA_getHavingQueryPanel()); - $response->addHTML(PMA_getAggregateQueryPanel()); - $response->addHTML(PMA_getWhereQueryPanel()); - $response->addHTML(PMA_getQueryDetails()); + $response->addHTML(Designer::getOptionsPanel()); + $response->addHTML(Designer::getRenameToPanel()); + $response->addHTML(Designer::getHavingQueryPanel()); + $response->addHTML(Designer::getAggregateQueryPanel()); + $response->addHTML(Designer::getWhereQueryPanel()); + $response->addHTML(Designer::getQueryDetails()); } $response->addHTML('
'); diff --git a/libraries/classes/Database/Designer.php b/libraries/classes/Database/Designer.php new file mode 100644 index 0000000000..e290c95d56 --- /dev/null +++ b/libraries/classes/Database/Designer.php @@ -0,0 +1,414 @@ +render( + array( + 'db' => $db, + 'cfgRelation' => $cfgRelation + ) + ); + } + + /** + * Function to get html for displaying the page edit/delete form + * + * @param string $db database name + * @param string $operation 'edit' or 'delete' depending on the operation + * + * @return string html content + */ + public static function getHtmlForEditOrDeletePages($db, $operation) + { + return Template::get('database/designer/edit_delete_pages') + ->render( + array( + 'db' => $db, + 'operation' => $operation + ) + ); + } + + /** + * Function to get html for displaying the page save as form + * + * @param string $db database name + * + * @return string html content + */ + public static function getHtmlForPageSaveAs($db) + { + return Template::get('database/designer/page_save_as') + ->render( + array( + 'db' => $db + ) + ); + } + + /** + * Retrieve IDs and names of schema pages + * + * @param string $db database name + * + * @return array array of schema page id and names + */ + public static function getPageIdsAndNames($db) + { + $cfgRelation = Relation::getRelationsParam(); + $page_query = "SELECT `page_nr`, `page_descr` FROM " + . Util::backquote($cfgRelation['db']) . "." + . Util::backquote($cfgRelation['pdf_pages']) + . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($db) . "'" + . " ORDER BY `page_descr`"; + $page_rs = Relation::queryAsControlUser( + $page_query, false, DatabaseInterface::QUERY_STORE + ); + + $result = array(); + while ($curr_page = $GLOBALS['dbi']->fetchAssoc($page_rs)) { + $result[intval($curr_page['page_nr'])] = $curr_page['page_descr']; + } + return $result; + } + + /** + * Function to get html for displaying the schema export + * + * @param string $db database name + * @param int $page the page to be exported + * + * @return string + */ + public static function getHtmlForSchemaExport($db, $page) + { + /* Scan for schema plugins */ + /* @var $export_list SchemaPlugin[] */ + $export_list = PMA_getPlugins( + "schema", + 'libraries/classes/Plugins/Schema/', + null + ); + + /* Fail if we didn't find any schema plugin */ + if (empty($export_list)) { + return Message::error( + __('Could not load schema plugins, please check your installation!') + )->getDisplay(); + } + + return Template::get('database/designer/schema_export') + ->render( + array( + 'db' => $db, + 'page' => $page, + 'export_list' => $export_list + ) + ); + } + + /** + * Returns HTML for including some variable to be accessed by JavaScript + * + * @param array $script_tables array on foreign key support for each table + * @param array $script_contr initialization data array + * @param array $script_display_field display fields of each table + * @param int $display_page page number of the selected page + * + * @return string html + */ + public static function getHtmlForJsFields( + $script_tables, $script_contr, $script_display_field, $display_page + ) { + return Template::get('database/designer/js_fields') + ->render( + array( + 'script_tables' => $script_tables, + 'script_contr' => $script_contr, + 'script_display_field' => $script_display_field, + 'display_page' => $display_page + ) + ); + } + + /** + * Returns HTML for the menu bar of the designer page + * + * @param boolean $visualBuilder whether this is visual query builder + * @param string $selected_page name of the selected page + * @param array $params_array array with class name for various buttons on side + * menu + * + * @return string html + */ + public static function getPageMenu($visualBuilder, $selected_page, $params_array) + { + return Template::get('database/designer/side_menu') + ->render( + array( + 'visualBuilder' => $visualBuilder, + 'selected_page' => $selected_page, + 'params_array' => $params_array + ) + ); + } + + /** + * Returns array of stored values of Designer Settings + * + * @return array stored values + */ + public static function getSideMenuParamsArray() + { + $params = array(); + + $cfgRelation = Relation::getRelationsParam(); + + if ($GLOBALS['cfgRelation']['designersettingswork']) { + + $query = 'SELECT `settings_data` FROM ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['designer_settings']) + . ' WHERE ' . Util::backquote('username') . ' = "' + . $GLOBALS['cfg']['Server']['user'] . '";'; + + $result = $GLOBALS['dbi']->fetchSingleRow($query); + + $params = json_decode($result['settings_data'], true); + } + + return $params; + } + + /** + * Returns class names for various buttons on Designer Side Menu + * + * @return array class names of various buttons + */ + public static function returnClassNamesFromMenuButtons() + { + $classes_array = array(); + $params_array = self::getSideMenuParamsArray(); + + if (isset($params_array['angular_direct']) + && $params_array['angular_direct'] == 'angular' + ) { + $classes_array['angular_direct'] = 'M_butt_Selected_down'; + } else { + $classes_array['angular_direct'] = 'M_butt'; + } + + if (isset($params_array['snap_to_grid']) + && $params_array['snap_to_grid'] == 'on' + ) { + $classes_array['snap_to_grid'] = 'M_butt_Selected_down'; + } else { + $classes_array['snap_to_grid'] = 'M_butt'; + } + + if (isset($params_array['pin_text']) + && $params_array['pin_text'] == 'true' + ) { + $classes_array['pin_text'] = 'M_butt_Selected_down'; + } else { + $classes_array['pin_text'] = 'M_butt'; + } + + if (isset($params_array['relation_lines']) + && $params_array['relation_lines'] == 'false' + ) { + $classes_array['relation_lines'] = 'M_butt_Selected_down'; + } else { + $classes_array['relation_lines'] = 'M_butt'; + } + + if (isset($params_array['small_big_all']) + && $params_array['small_big_all'] == 'v' + ) { + $classes_array['small_big_all'] = 'M_butt_Selected_down'; + } else { + $classes_array['small_big_all'] = 'M_butt'; + } + + if (isset($params_array['side_menu']) + && $params_array['side_menu'] == 'true' + ) { + $classes_array['side_menu'] = 'M_butt_Selected_down'; + } else { + $classes_array['side_menu'] = 'M_butt'; + } + + return $classes_array; + } + + /** + * Returns HTML for the canvas element + * + * @return string html + */ + public static function getHtmlCanvas() + { + return Template::get('database/designer/canvas')->render(); + } + + /** + * Return HTML for the table list + * + * @param array $tab_pos table positions + * @param int $display_page page number of the selected page + * + * @return string html + */ + public static function getHtmlTableList($tab_pos, $display_page) + { + return Template::get('database/designer/table_list') + ->render( + array( + 'tab_pos' => $tab_pos, + 'display_page' => $display_page + ) + ); + } + + /** + * Get HTML to display tables on designer page + * + * @param array $tab_pos tables positions + * @param int $display_page page number of the selected page + * @param array $tab_column table column info + * @param array $tables_all_keys all indices + * @param array $tables_pk_or_unique_keys unique or primary indices + * + * @return string html + */ + public static function getDatabaseTables( + $tab_pos, $display_page, $tab_column, $tables_all_keys, $tables_pk_or_unique_keys + ) { + return Template::get('database/designer/database_tables') + ->render( + array( + 'tab_pos' => $tab_pos, + 'display_page' => $display_page, + 'tab_column' => $tab_column, + 'tables_all_keys' => $tables_all_keys, + 'tables_pk_or_unique_keys' => $tables_pk_or_unique_keys + ) + ); + } + + /** + * Returns HTML for the new relations panel. + * + * @return string html + */ + public static function getNewRelationPanel() + { + return Template::get('database/designer/new_relation_panel') + ->render(); + } + + /** + * Returns HTML for the relations delete panel + * + * @return string html + */ + public static function getDeleteRelationPanel() + { + return Template::get('database/designer/delete_relation_panel') + ->render(); + } + + /** + * Returns HTML for the options panel + * + * @return string html + */ + public static function getOptionsPanel() + { + return Template::get('database/designer/options_panel')->render(); + } + + /** + * Get HTML for the 'rename to' panel + * + * @return string html + */ + public static function getRenameToPanel() + { + return Template::get('database/designer/rename_to_panel') + ->render(); + } + + /** + * Returns HTML for the 'having' panel + * + * @return string html + */ + public static function getHavingQueryPanel() + { + return Template::get('database/designer/having_query_panel') + ->render(); + } + + /** + * Returns HTML for the 'aggregate' panel + * + * @return string html + */ + public static function getAggregateQueryPanel() + { + return Template::get('database/designer/aggregate_query_panel') + ->render(); + } + + /** + * Returns HTML for the 'where' panel + * + * @return string html + */ + public static function getWhereQueryPanel() + { + return Template::get('database/designer/where_query_panel') + ->render(); + } + + /** + * Returns HTML for the query details panel + * + * @return string html + */ + public static function getQueryDetails() + { + return Template::get('database/designer/query_details')->render(); + } +} diff --git a/libraries/db_designer.lib.php b/libraries/db_designer.lib.php deleted file mode 100644 index c6f6ef8ce5..0000000000 --- a/libraries/db_designer.lib.php +++ /dev/null @@ -1,405 +0,0 @@ -render( - array( - 'db' => $db, - 'cfgRelation' => $cfgRelation - ) - ); -} - -/** - * Function to get html for displaying the page edit/delete form - * - * @param string $db database name - * @param string $operation 'edit' or 'delete' depending on the operation - * - * @return string html content - */ -function PMA_getHtmlForEditOrDeletePages($db, $operation) -{ - return PhpMyAdmin\Template::get('database/designer/edit_delete_pages') - ->render( - array( - 'db' => $db, - 'operation' => $operation - ) - ); -} - -/** - * Function to get html for displaying the page save as form - * - * @param string $db database name - * - * @return string html content - */ -function PMA_getHtmlForPageSaveAs($db) -{ - return PhpMyAdmin\Template::get('database/designer/page_save_as') - ->render( - array( - 'db' => $db - ) - ); -} - -/** - * Retrieve IDs and names of schema pages - * - * @param string $db database name - * - * @return array array of schema page id and names - */ -function PMA_getPageIdsAndNames($db) -{ - $cfgRelation = Relation::getRelationsParam(); - $page_query = "SELECT `page_nr`, `page_descr` FROM " - . PhpMyAdmin\Util::backquote($cfgRelation['db']) . "." - . PhpMyAdmin\Util::backquote($cfgRelation['pdf_pages']) - . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($db) . "'" - . " ORDER BY `page_descr`"; - $page_rs = Relation::queryAsControlUser( - $page_query, false, PhpMyAdmin\DatabaseInterface::QUERY_STORE - ); - - $result = array(); - while ($curr_page = $GLOBALS['dbi']->fetchAssoc($page_rs)) { - $result[intval($curr_page['page_nr'])] = $curr_page['page_descr']; - } - return $result; -} - -/** - * Function to get html for displaying the schema export - * - * @param string $db database name - * @param int $page the page to be exported - * - * @return string - */ -function PMA_getHtmlForSchemaExport($db, $page) -{ - /* Scan for schema plugins */ - /* @var $export_list SchemaPlugin[] */ - $export_list = PMA_getPlugins( - "schema", - 'libraries/classes/Plugins/Schema/', - null - ); - - /* Fail if we didn't find any schema plugin */ - if (empty($export_list)) { - return Message::error( - __('Could not load schema plugins, please check your installation!') - )->getDisplay(); - } - - return PhpMyAdmin\Template::get('database/designer/schema_export') - ->render( - array( - 'db' => $db, - 'page' => $page, - 'export_list' => $export_list - ) - ); -} - -/** - * Returns HTML for including some variable to be accessed by JavaScript - * - * @param array $script_tables array on foreign key support for each table - * @param array $script_contr initialization data array - * @param array $script_display_field display fields of each table - * @param int $display_page page number of the selected page - * - * @return string html - */ -function PMA_getHtmlForJSFields( - $script_tables, $script_contr, $script_display_field, $display_page -) { - return PhpMyAdmin\Template::get('database/designer/js_fields') - ->render( - array( - 'script_tables' => $script_tables, - 'script_contr' => $script_contr, - 'script_display_field' => $script_display_field, - 'display_page' => $display_page - ) - ); -} - -/** - * Returns HTML for the menu bar of the designer page - * - * @param boolean $visualBuilder whether this is visual query builder - * @param string $selected_page name of the selected page - * @param array $params_array array with class name for various buttons on side - * menu - * - * @return string html - */ -function PMA_getDesignerPageMenu($visualBuilder, $selected_page, $params_array) -{ - return PhpMyAdmin\Template::get('database/designer/side_menu') - ->render( - array( - 'visualBuilder' => $visualBuilder, - 'selected_page' => $selected_page, - 'params_array' => $params_array - ) - ); -} - -/** - * Returns array of stored values of Designer Settings - * - * @return array stored values - */ -function PMA_getSideMenuParamsArray() -{ - $params = array(); - - $cfgRelation = Relation::getRelationsParam(); - - if ($GLOBALS['cfgRelation']['designersettingswork']) { - - $query = 'SELECT `settings_data` FROM ' - . PhpMyAdmin\Util::backquote($cfgRelation['db']) . '.' - . PhpMyAdmin\Util::backquote($cfgRelation['designer_settings']) - . ' WHERE ' . PhpMyAdmin\Util::backquote('username') . ' = "' - . $GLOBALS['cfg']['Server']['user'] . '";'; - - $result = $GLOBALS['dbi']->fetchSingleRow($query); - - $params = json_decode($result['settings_data'], true); - } - - return $params; -} - -/** - * Returns class names for various buttons on Designer Side Menu - * - * @return array class names of various buttons - */ -function PMA_returnClassNamesFromMenuButtons() -{ - $classes_array = array(); - $params_array = PMA_getSideMenuParamsArray(); - - if (isset($params_array['angular_direct']) - && $params_array['angular_direct'] == 'angular' - ) { - $classes_array['angular_direct'] = 'M_butt_Selected_down'; - } else { - $classes_array['angular_direct'] = 'M_butt'; - } - - if (isset($params_array['snap_to_grid']) - && $params_array['snap_to_grid'] == 'on' - ) { - $classes_array['snap_to_grid'] = 'M_butt_Selected_down'; - } else { - $classes_array['snap_to_grid'] = 'M_butt'; - } - - if (isset($params_array['pin_text']) - && $params_array['pin_text'] == 'true' - ) { - $classes_array['pin_text'] = 'M_butt_Selected_down'; - } else { - $classes_array['pin_text'] = 'M_butt'; - } - - if (isset($params_array['relation_lines']) - && $params_array['relation_lines'] == 'false' - ) { - $classes_array['relation_lines'] = 'M_butt_Selected_down'; - } else { - $classes_array['relation_lines'] = 'M_butt'; - } - - if (isset($params_array['small_big_all']) - && $params_array['small_big_all'] == 'v' - ) { - $classes_array['small_big_all'] = 'M_butt_Selected_down'; - } else { - $classes_array['small_big_all'] = 'M_butt'; - } - - if (isset($params_array['side_menu']) - && $params_array['side_menu'] == 'true' - ) { - $classes_array['side_menu'] = 'M_butt_Selected_down'; - } else { - $classes_array['side_menu'] = 'M_butt'; - } - - return $classes_array; -} - -/** - * Returns HTML for the canvas element - * - * @return string html - */ -function PMA_getHTMLCanvas() -{ - return PhpMyAdmin\Template::get('database/designer/canvas')->render(); -} - -/** - * Return HTML for the table list - * - * @param array $tab_pos table positions - * @param int $display_page page number of the selected page - * - * @return string html - */ -function PMA_getHTMLTableList($tab_pos, $display_page) -{ - return PhpMyAdmin\Template::get('database/designer/table_list') - ->render( - array( - 'tab_pos' => $tab_pos, - 'display_page' => $display_page - ) - ); -} - -/** - * Get HTML to display tables on designer page - * - * @param array $tab_pos tables positions - * @param int $display_page page number of the selected page - * @param array $tab_column table column info - * @param array $tables_all_keys all indices - * @param array $tables_pk_or_unique_keys unique or primary indices - * - * @return string html - */ -function PMA_getDatabaseTables( - $tab_pos, $display_page, $tab_column, $tables_all_keys, $tables_pk_or_unique_keys -) { - return PhpMyAdmin\Template::get('database/designer/database_tables') - ->render( - array( - 'tab_pos' => $tab_pos, - 'display_page' => $display_page, - 'tab_column' => $tab_column, - 'tables_all_keys' => $tables_all_keys, - 'tables_pk_or_unique_keys' => $tables_pk_or_unique_keys - ) - ); -} - -/** - * Returns HTML for the new relations panel. - * - * @return string html - */ -function PMA_getNewRelationPanel() -{ - return PhpMyAdmin\Template::get('database/designer/new_relation_panel') - ->render(); -} - -/** - * Returns HTML for the relations delete panel - * - * @return string html - */ -function PMA_getDeleteRelationPanel() -{ - return PhpMyAdmin\Template::get('database/designer/delete_relation_panel') - ->render(); -} - -/** - * Returns HTML for the options panel - * - * @return string html - */ -function PMA_getOptionsPanel() -{ - return PhpMyAdmin\Template::get('database/designer/options_panel')->render(); -} - -/** - * Get HTML for the 'rename to' panel - * - * @return string html - */ -function PMA_getRenameToPanel() -{ - return PhpMyAdmin\Template::get('database/designer/rename_to_panel') - ->render(); -} - -/** - * Returns HTML for the 'having' panel - * - * @return string html - */ -function PMA_getHavingQueryPanel() -{ - return PhpMyAdmin\Template::get('database/designer/having_query_panel') - ->render(); -} - -/** - * Returns HTML for the 'aggregate' panel - * - * @return string html - */ -function PMA_getAggregateQueryPanel() -{ - return PhpMyAdmin\Template::get('database/designer/aggregate_query_panel') - ->render(); -} - -/** - * Returns HTML for the 'where' panel - * - * @return string html - */ -function PMA_getWhereQueryPanel() -{ - return PhpMyAdmin\Template::get('database/designer/where_query_panel') - ->render(); -} - -/** - * Returns HTML for the query details panel - * - * @return string html - */ -function PMA_getQueryDetails() -{ - return PhpMyAdmin\Template::get('database/designer/query_details')->render(); -} diff --git a/templates/database/designer/edit_delete_pages.phtml b/templates/database/designer/edit_delete_pages.phtml index a30f9b881e..44e9f466de 100644 --- a/templates/database/designer/edit_delete_pages.phtml +++ b/templates/database/designer/edit_delete_pages.phtml @@ -6,6 +6,6 @@ - +
diff --git a/templates/database/designer/page_save_as.phtml b/templates/database/designer/page_save_as.phtml index c50d301498..5c02663f78 100644 --- a/templates/database/designer/page_save_as.phtml +++ b/templates/database/designer/page_save_as.phtml @@ -13,7 +13,7 @@ $choices = array( - + diff --git a/templates/database/designer/page_selector.phtml b/templates/database/designer/page_selector.phtml index 67863d2dc4..c0c0844bd9 100644 --- a/templates/database/designer/page_selector.phtml +++ b/templates/database/designer/page_selector.phtml @@ -1,10 +1,10 @@ \ No newline at end of file + diff --git a/test/libraries/PMA_designer_test.php b/test/classes/Database/DesignerTest.php similarity index 88% rename from test/libraries/PMA_designer_test.php rename to test/classes/Database/DesignerTest.php index 625533ba6f..b57c657b06 100644 --- a/test/libraries/PMA_designer_test.php +++ b/test/classes/Database/DesignerTest.php @@ -1,22 +1,26 @@ will($this->returnValue('dummyRS')); @@ -86,7 +90,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getPageIdsAndNames() + * Test for Designer::getPageIdsAndNames() * * @return void */ @@ -95,7 +99,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase $db = 'db'; $this->_mockDatabaseInteraction($db); - $result = PMA_getPageIdsAndNames($db); + $result = Designer::getPageIdsAndNames($db); $this->assertEquals( array( @@ -107,7 +111,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getHtmlForEditOrDeletePages() + * Test for Designer::getHtmlForEditOrDeletePages() * * @return void */ @@ -117,7 +121,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase $operation = 'edit'; $this->_mockDatabaseInteraction($db); - $result = PMA_getHtmlForEditOrDeletePages($db, $operation); + $result = Designer::getHtmlForEditOrDeletePages($db, $operation); $this->assertContains( '', $result @@ -134,7 +138,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getHtmlForPageSaveAs() + * Test for Designer::getHtmlForPageSaveAs() * * @return void */ @@ -143,7 +147,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase $db = 'db'; $this->_mockDatabaseInteraction($db); - $result = PMA_getHtmlForPageSaveAs($db); + $result = Designer::getHtmlForPageSaveAs($db); $this->assertContains( '', $result @@ -174,7 +178,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getHtmlForSchemaExport() + * Test for Designer::getHtmlForSchemaExport() * * @return void */ @@ -183,7 +187,7 @@ class PMA_DesignerTest extends PHPUnit_Framework_TestCase $db = 'db'; $page = 2; - $result = PMA_getHtmlForSchemaExport($db, $page); + $result = Designer::getHtmlForSchemaExport($db, $page); // export type $this->assertContains( '