/** * Test for PMA_getPluginAndModuleInfo * * @return void */ public function testPMAGetPluginAndModuleInfo() { //Mock DBI $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock(); $GLOBALS['dbi'] = $dbi; //Call the test function /** * Prepare plugin list */ $plugins = array(); $row = array(); $row["plugin_name"] = "plugin_name1"; $row["plugin_type"] = "plugin_type1"; $row["plugin_type_version"] = "plugin_version1"; $row["plugin_author"] = "plugin_author1"; $row["plugin_license"] = "plugin_license1"; $row["plugin_description"] = "plugin_description1"; $row["is_active"] = true; $plugins[$row['plugin_type']][] = $row; $html = PMA_getPluginTab($plugins); //validate 1:Items $this->assertContains('<th>Plugin</th>', $html); $this->assertContains('<th>Description</th>', $html); $this->assertContains('<th>Version</th>', $html); $this->assertContains('<th>Author</th>', $html); $this->assertContains('<th>License</th>', $html); //validate 2: one Item HTML $this->assertContains('<th>plugin_name1</th>', $html); $this->assertContains('<td>plugin_description1</td>', $html); $this->assertContains('<td>plugin_version1</td>', $html); $this->assertContains('<td>plugin_author1</td>', $html); $this->assertContains('<td>plugin_license1</td>', $html); }
/** * Returns the html for plugin and module Info. * * @param Array $plugins Plugin list * * @param Array $modules Module list * * @return string */ function PMA_getPluginAndModuleInfo($plugins, $modules) { $html = '<script type="text/javascript">'; $html .= 'pma_theme_image = "' . $GLOBALS['pmaThemeImage'] . '"'; $html .= '</script>'; $html .= '<div id="pluginsTabs">'; $html .= '<ul>'; $html .= '<li><a href="#plugins_plugins">' . __('Plugins') . '</a></li>'; $html .= '<li><a href="#plugins_modules">' . __('Modules') . '</a></li>'; $html .= '</ul>'; $html .= PMA_getPluginTab($plugins); $html .= PMA_getModuleTab($modules); $html .= '</div>'; return $html; }
/* vim: set expandtab sw=4 ts=4 sts=4: */ /** * object the server plugin page * * @package PhpMyAdmin */ /** * requirements */ require_once 'libraries/common.inc.php'; /** * JS includes */ $response = PMA_Response::getInstance(); $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('jquery/jquery.tablesorter.js'); $scripts->addFile('server_plugins.js'); /** * Does the common work */ require 'libraries/server_common.inc.php'; require 'libraries/server_plugins.lib.php'; $plugins = PMA_getServerPlugins(); /** * Displays the page */ $response->addHTML(PMA_getHtmlForSubPageHeader('plugins')); $response->addHTML(PMA_getPluginTab($plugins)); exit;