1, 'ActionLinksMode' => 'icons', ); $GLOBALS['cfg']['DBG']['sql'] = false; $GLOBALS['server'] = 1; $GLOBALS['db_priv'] = true; $GLOBALS['table_priv'] = true; $GLOBALS['col_priv'] = true; $GLOBALS['proc_priv'] = true; $GLOBALS['flush_priv'] = true; } /** * Test for PMA_getHtmlForDatabaseComment * * @return void */ public function testGetHtmlForDatabaseComment() { $this->assertRegExp( '/.*db_operations.php(.|[\n])*Database comment.*name="comment"([\n]|.)*/m', PMA_getHtmlForDatabaseComment("pma") ); } /** * Test for PMA_getHtmlForRenameDatabase * * @return void */ public function testGetHtmlForRenameDatabase() { $_REQUEST['db_collation'] = 'db1'; $html = PMA_getHtmlForRenameDatabase("pma"); $this->assertContains('db_operations.php', $html); $this->assertRegExp( '/.*db_rename.*Rename database to.*/', $html ); } /** * Test for PMA_getHtmlForDropDatabaseLink * * @return void */ public function testGetHtmlForDropDatabaseLink() { $this->assertRegExp( '/.*DROP.DATABASE.*db_operations.php.*Drop the database.*/', PMA_getHtmlForDropDatabaseLink("pma") ); } /** * 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); } /** * Test for PMA_getHtmlForChangeDatabaseCharset * * @return void */ public function testGetHtmlForChangeDatabaseCharset() { $_REQUEST['db_collation'] = 'db1'; $this->assertRegExp( '/.*db_operations.php(.|[\n])*select_db_collation([\n]|.)*Collation.*/m', PMA_getHtmlForChangeDatabaseCharset("pma", "bookmark") ); } /** * Test for PMA_getHtmlForOrderTheTable * * @return void */ public function testGetHtmlForOrderTheTable() { $this->assertRegExp( '/.*tbl_operations.php(.|[\n])*Alter table order by([\n]|.)*order_order.*/m', PMA_getHtmlForOrderTheTable( array(array('Field' => "column1"), array('Field' => "column2")) ) ); } /** * Test for PMA_getHtmlForTableRow * * @return void */ public function testGetHtmlForTableRow() { $this->assertEquals( '