diff --git a/libraries/user_preferences.lib.php b/libraries/user_preferences.lib.php index 8697a75b8b..910e603dae 100644 --- a/libraries/user_preferences.lib.php +++ b/libraries/user_preferences.lib.php @@ -175,6 +175,10 @@ function PMA_readUserprefsFieldNames(array $forms = null) { static $names; + if (defined('TESTSUITE')) { + $names = null; + } + // return cached results if ($names !== null) { return $names; diff --git a/test/libraries/PMA_ConfigGenerator_test.php b/test/libraries/PMA_ConfigGenerator_test.php index c6a8a8aad2..41912fa0a4 100644 --- a/test/libraries/PMA_ConfigGenerator_test.php +++ b/test/libraries/PMA_ConfigGenerator_test.php @@ -39,6 +39,7 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase $GLOBALS['server'] = 0; $cf = ConfigFile::getInstance(); + $_SESSION['ConfigFile0'] = array('a', 'b', 'c'); $_SESSION['ConfigFile0']['Servers'] = array( array(1, 2, 3) ); diff --git a/test/libraries/PMA_FormDisplay_tpl_test.php b/test/libraries/PMA_FormDisplay_tpl_test.php index 97ceed7d8d..72d492505c 100644 --- a/test/libraries/PMA_FormDisplay_tpl_test.php +++ b/test/libraries/PMA_FormDisplay_tpl_test.php @@ -233,6 +233,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase $opts['doc'] = "http://doclink"; $opts['wiki'] = "http://wikilink"; $opts['comment'] = "testComment"; + $opts['comment_warning'] = true; $opts['show_restore_default'] = true; ob_start(); PMA_displayInput( @@ -319,7 +320,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase $this->assertTag( $this->_getTagArray( - '', + '', array('content' => 'i') ), $result diff --git a/test/libraries/PMA_user_preferences_test.php b/test/libraries/PMA_user_preferences_test.php index f71420aa63..5320ba5976 100644 --- a/test/libraries/PMA_user_preferences_test.php +++ b/test/libraries/PMA_user_preferences_test.php @@ -293,16 +293,26 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_readUserprefsFieldNames - * This test would only work when executed with other tests. - * This is to test "static" nature of this function * * @return void */ public function testReadUserprefsFieldNames() { + $this->assertCount( + 216, + PMA_readUserprefsFieldNames() + ); + + $forms = array( + 'form1' => array( + array('Servers/1/hide_db', 'bar'), + array('test' => 'val') + ) + ); + $this->assertEquals( array('Servers/1/hide_db', 'bar', 'test'), - PMA_readUserprefsFieldNames(array()) + PMA_readUserprefsFieldNames($forms) ); }