Merge pull request #551 from adamgsoc2013/UT_plu_table

test case for PMA_Table and PMA_relation
This commit is contained in:
Michal Čihař 2013-07-31 01:34:57 -07:00
commit 9bf9693d78
2 changed files with 59 additions and 0 deletions

View File

@ -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
*

View File

@ -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 = "<strong>not OK</strong>";
$this->assertContains(
$result,
$retval
);
$GLOBALS['cfg']['Server']['pmadb'] = $value;
}
/**