diff --git a/test/classes/PMA_Table_test.php b/test/classes/PMA_Table_test.php index b01e933cf5..17e35b05fa 100644 --- a/test/classes/PMA_Table_test.php +++ b/test/classes/PMA_Table_test.php @@ -45,6 +45,9 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $GLOBALS['cfg']['MaxExactCount'] = 100; $GLOBALS['cfg']['MaxExactCountViews'] = 100; + $GLOBALS['cfg']['Server']['pmadb'] = "pmadb"; + $GLOBALS['cfg']['Server']['table_uiprefs'] = "pma__table_uiprefs"; + $_SESSION['PMA_Theme'] = new PMA_Theme(); $GLOBALS['pmaThemeImage'] = 'themes/dot.gif'; $GLOBALS['is_ajax_request'] = false; @@ -745,6 +748,38 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase ); } + /** + * Test for setUiProp + * + * @return void + */ + public function testSetUiProp() + { + $table_name = 'PMA_BookMark'; + $db = 'PMA'; + + $table = new PMA_Table($table_name, $db); + + $property = PMA_Table::PROP_COLUMN_ORDER; + $value = "UiProp_value"; + $table_create_time = null; + $table->setUiProp($property, $value, $table_create_time); + + //set UI prop successfully + $this->assertEquals( + $value, + $table->uiprefs[$property] + ); + + //removeUiProp + $table->removeUiProp($property); + $is_define_property = isset($table->uiprefs[$property]) ? true : false; + $this->assertEquals( + false, + $is_define_property + ); + } + /** * Test for moveCopy * diff --git a/test/libraries/PMA_relation_test.php b/test/libraries/PMA_relation_test.php index d1272cd975..e301222c35 100644 --- a/test/libraries/PMA_relation_test.php +++ b/test/libraries/PMA_relation_test.php @@ -135,6 +135,30 @@ class PMA_Relation_Test extends PHPUnit_Framework_TestCase $result, $retval ); + + //$GLOBALS['cfg']['Server']['pmadb']==false + $value = $GLOBALS['cfg']['Server']['pmadb']; + $GLOBALS['cfg']['Server']['pmadb'] = false; + $retval = PMA_getRelationsParamDiagnostic($relationsPara); + + $result = __('General relation features'); + $this->assertContains( + $result, + $retval + ); + $result = 'PMA Database ... '; + $this->assertContains( + $result, + $retval + ); + $result = "not OK"; + $this->assertContains( + $result, + $retval + ); + + $GLOBALS['cfg']['Server']['pmadb'] = $value; + } /**