diff --git a/test/classes/PMA_Table_test.php b/test/classes/PMA_Table_test.php index b01e933cf5fc..17e35b05fab4 100644 --- a/test/classes/PMA_Table_test.php +++ b/test/classes/PMA_Table_test.php @@ -45,6 +45,9 @@ protected function setUp() $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 @@ public function testCountRecords() ); } + /** + * 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 *