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; $GLOBALS['cfg']['Server']['DisableIS'] = false; } /** * Test for Operations::getHtmlForDatabaseComment * * @return void */ public function testGetHtmlForDatabaseComment() { $this->assertRegExp( '/.*db_operations.php(.|[\n])*Database comment.*name="comment"([\n]|.)*/m', Operations::getHtmlForDatabaseComment("pma") ); } /** * Test for Operations::getHtmlForRenameDatabase * * @return void */ public function testGetHtmlForRenameDatabase() { $_REQUEST['db_collation'] = 'db1'; $html = Operations::getHtmlForRenameDatabase("pma"); $this->assertContains('db_operations.php', $html); $this->assertRegExp( '/.*db_rename.*Rename database to.*/', $html ); } /** * Test for Operations::getHtmlForDropDatabaseLink * * @return void */ public function testGetHtmlForDropDatabaseLink() { $this->assertRegExp( '/.*DROP.DATABASE.*db_operations.php.*Drop the database.*/', Operations::getHtmlForDropDatabaseLink("pma") ); } /** * Test for Operations::getHtmlForCopyDatabase * * @return void */ public function testGetHtmlForCopyDatabase() { $_REQUEST['db_collation'] = 'db1'; $html = Operations::getHtmlForCopyDatabase("pma"); $this->assertRegExp('/.*db_operations.php.*/', $html); $this->assertRegExp('/.*db_copy.*/', $html); $this->assertRegExp('/.*Copy database to.*/', $html); } /** * Test for Operations::getHtmlForChangeDatabaseCharset * * @return void */ public function testGetHtmlForChangeDatabaseCharset() { $_REQUEST['db_collation'] = 'db1'; $result = Operations::getHtmlForChangeDatabaseCharset("pma", "bookmark"); $this->assertRegExp( '/.*select_db_collation.*Collation.*/m', $result ); $this->assertRegExp( '/.*db_operations.php.*/', $result ); } /** * Test for Operations::getHtmlForOrderTheTable * * @return void */ public function testGetHtmlForOrderTheTable() { $this->assertRegExp( '/.*tbl_operations.php(.|[\n])*Alter table order by([\n]|.)*order_order.*/m', Operations::getHtmlForOrderTheTable( array(array('Field' => "column1"), array('Field' => "column2")) ) ); } /** * Test for Operations::getHtmlForTableRow * * @return void */ public function testGetHtmlForTableRow() { $this->assertEquals( '