From 536ebb21aa8f8be9c4857c2ddcf140237685a509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 19 Sep 2012 20:03:06 +0200 Subject: [PATCH 1/9] Fix typo --- tbl_tracking.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbl_tracking.php b/tbl_tracking.php index e75df7f7a3..6ead489b2b 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -504,7 +504,7 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) { . '' - ''; + . ''; $str2 = ''; $str3 = 'name; -// $privates[$aname] = $parseable->$aname; -// } -// -// $this->assertFalse($priv_attr[3]->_isEnable); -// } + /** + * Test for disable + * + * @return void + */ + public function testDisable() + { + $footer = new PMA_Footer(); + $footer->disable(); + $this->assertEquals( + '', + $footer->getDisplay() + ); + } } From ba5b4cd2a6269dd7f426a050fa30141e318c65ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 21 Sep 2012 15:31:50 +0200 Subject: [PATCH 6/9] Add simple test for displaying footer --- test/classes/PMA_Footer_test.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/classes/PMA_Footer_test.php b/test/classes/PMA_Footer_test.php index 32d8fc4425..c028c508b7 100644 --- a/test/classes/PMA_Footer_test.php +++ b/test/classes/PMA_Footer_test.php @@ -16,6 +16,8 @@ require_once 'libraries/url_generating.lib.php'; require_once 'libraries/php-gettext/gettext.inc'; require_once 'libraries/Util.class.php'; require_once 'libraries/Theme.class.php'; +require_once 'libraries/Error_Handler.class.php'; +require_once 'libraries/vendor_config.php'; /** * Tests for Footer class @@ -46,6 +48,8 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase { $GLOBALS['lang'] = 'en'; $GLOBALS['collation_connection'] = 'utf8_general_ci'; + $GLOBALS['cfg']['Error_Handler']['gather'] = false; + $GLOBALS['cfg']['Error_Handler']['display'] = false; $GLOBALS['server'] = '1'; $_SESSION[' PMA_token '] = 'token'; $_GET['reload_left_frame'] = '1'; @@ -53,6 +57,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase $this->object = new PMA_Footer(); unset($GLOBALS['error_message']); unset($GLOBALS['sql_query']); + $GLOBALS['error_handler'] = new PMA_Error_Handler(); } /** @@ -171,4 +176,18 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase $footer->getDisplay() ); } + + /** + * Test for displaying footer + * + * @return void + */ + public function testDisplay() + { + $footer = new PMA_Footer(); + $this->assertContains( + 'Open new phpMyAdmin window', + $footer->getDisplay() + ); + } } From 8a1d19ee4e2b3cfc9583e89adf9bee45949952ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 21 Sep 2012 15:36:11 +0200 Subject: [PATCH 7/9] Single place to define MySQL version used in tests --- test/bootstrap-dist.php | 1 + test/classes/PMA_Menu_test.php | 4 ---- test/classes/PMA_Types_Drizzle_test.php | 7 ------- test/classes/PMA_Types_MySQL_test.php | 5 ----- test/libraries/rte/PMA_RTN_getExecuteForm_test.php | 5 ----- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php index 5ad7e4c488..58adcf8155 100644 --- a/test/bootstrap-dist.php +++ b/test/bootstrap-dist.php @@ -7,6 +7,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(realpath("../inde // Setting constants for testing define('PHPMYADMIN', 1); define('TESTSUITE', 1); +define('PMA_MYSQL_INT_VERSION', 55000); session_start(); diff --git a/test/classes/PMA_Menu_test.php b/test/classes/PMA_Menu_test.php index 427f282760..11bca4b031 100644 --- a/test/classes/PMA_Menu_test.php +++ b/test/classes/PMA_Menu_test.php @@ -39,10 +39,6 @@ class PMA_Menu_Test extends PHPUnit_Framework_TestCase if (!defined('PMA_IS_WINDOWS')) { define('PMA_IS_WINDOWS', false); } - if (! defined('PMA_MYSQL_INT_VERSION')) { - define('PMA_MYSQL_INT_VERSION', 55000); - } - $GLOBALS['cfg']['Server']['DisableIS'] = false; $GLOBALS['server'] = 0; $GLOBALS['cfg']['ServerDefault'] = 1; diff --git a/test/classes/PMA_Types_Drizzle_test.php b/test/classes/PMA_Types_Drizzle_test.php index 16e8480c9e..2c654e13f8 100644 --- a/test/classes/PMA_Types_Drizzle_test.php +++ b/test/classes/PMA_Types_Drizzle_test.php @@ -322,11 +322,6 @@ class PMA_Types_Drizzle_test extends PHPUnit_Framework_TestCase */ public function testGetColumns() { - - if (! defined('PMA_MYSQL_INT_VERSION')) { - define('PMA_MYSQL_INT_VERSION', 20120130); - } - $this->assertEquals( array( 0 => 'INT', @@ -358,8 +353,6 @@ class PMA_Types_Drizzle_test extends PHPUnit_Framework_TestCase 'BLOB', '-', 'ENUM', - '-', - 'IPV6' ), ), $this->object->getColumns() diff --git a/test/classes/PMA_Types_MySQL_test.php b/test/classes/PMA_Types_MySQL_test.php index bdca3b4ac5..11d7afce28 100644 --- a/test/classes/PMA_Types_MySQL_test.php +++ b/test/classes/PMA_Types_MySQL_test.php @@ -285,11 +285,6 @@ class PMA_Types_MySQL_Test extends PHPUnit_Framework_TestCase */ public function testGetFunctionsClass($class, $output) { - - if (! defined('PMA_MYSQL_INT_VERSION')) { - define('PMA_MYSQL_INT_VERSION', 60000); - } - $this->assertEquals( $output, $this->object->getFunctionsClass($class) diff --git a/test/libraries/rte/PMA_RTN_getExecuteForm_test.php b/test/libraries/rte/PMA_RTN_getExecuteForm_test.php index f64d99a0b6..11b526ed4c 100644 --- a/test/libraries/rte/PMA_RTN_getExecuteForm_test.php +++ b/test/libraries/rte/PMA_RTN_getExecuteForm_test.php @@ -23,11 +23,6 @@ class PMA_RTN_getExecuteForm_test extends PHPUnit_Framework_TestCase public function setUp() { global $cfg; - - if (! defined('PMA_MYSQL_INT_VERSION')) { - define('PMA_MYSQL_INT_VERSION', 55000); - } - $GLOBALS['PMA_Types'] = new PMA_Types_MySQL(); $GLOBALS['server'] = 0; $cfg['ServerDefault'] = 1; From 9a82e9d3ca90c94119a351fb05ce5aa9c19674cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 21 Sep 2012 16:01:02 +0200 Subject: [PATCH 8/9] Adjust MySQL version to new default --- test/classes/PMA_DbSearch_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/classes/PMA_DbSearch_test.php b/test/classes/PMA_DbSearch_test.php index d30d896c33..d4b4642e57 100644 --- a/test/classes/PMA_DbSearch_test.php +++ b/test/classes/PMA_DbSearch_test.php @@ -170,7 +170,7 @@ class PMA_DbSearch_test extends PHPUnit_Framework_TestCase
-
+
Inside tables:Select All  / Unselect AllInside column:

', $this->object->getSelectionForm($url_params) ); From 64cded2443b5c588e9a00e7fd2918049b18c2bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 21 Sep 2012 16:02:52 +0200 Subject: [PATCH 9/9] Unset POST array before test --- libraries/Footer.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php index d999d16092..074134434b 100644 --- a/libraries/Footer.class.php +++ b/libraries/Footer.class.php @@ -61,6 +61,7 @@ class PMA_Footer $this->_scripts = new PMA_Scripts(); $this->_isMinimal = false; $this->_addDefaultScripts(); + unset($POST); } /**