[Phpmyadmin-git] [SCM] phpMyAdmin branch, unittesting, updated. RELEASE_3_4_3_1-6561-gf81c001

Herman van Rink helmo at users.sourceforge.net
Wed Jul 6 11:04:16 CEST 2011


The branch, unittesting has been updated
       via  f81c001f76af2f39cbdc15002feefaa3821676ec (commit)
       via  60a2e5b3f312adf7acbe1c9ee01c21a70f9d07cf (commit)
       via  2e93b81172585e694c8dfdb4aa41a9272b90971e (commit)
       via  91709ec0c18074299b9e8560653018a9ff9206d3 (commit)
       via  39cb55a0defbf2634b2bc097f96e0d559303f5f7 (commit)
       via  82f83dac2f6b07bef76f6c3fb795ce7c0c417af8 (commit)
       via  70c70db1392e703346434e65d59110a6ba321367 (commit)
       via  a88054dae9a969c0c9ec6477fce130b70a777749 (commit)
       via  39cb4d4798f495db25bf65dda95fc8c4e9893367 (commit)
       via  064d399d878f36a0a26f6db890b947bccb3ef8ab (commit)
       via  2ec0de3a9f8d77c750f02c27ba8d83b407a87ea5 (commit)
      from  fc5a9a6131f9bec3c7f8c91666f483b9487c1132 (commit)


- Log -----------------------------------------------------------------
commit f81c001f76af2f39cbdc15002feefaa3821676ec
Merge: 60a2e5b3f312adf7acbe1c9ee01c21a70f9d07cf 2e93b81172585e694c8dfdb4aa41a9272b90971e
Author: Herman van Rink <rink at initfour.nl>
Date:   Wed Jul 6 11:03:46 2011 +0200

    Merge remote-tracking branch 'zarubin/master' into unittesting

commit 60a2e5b3f312adf7acbe1c9ee01c21a70f9d07cf
Merge: fc5a9a6131f9bec3c7f8c91666f483b9487c1132 39cb55a0defbf2634b2bc097f96e0d559303f5f7
Author: Herman van Rink <rink at initfour.nl>
Date:   Wed Jul 6 10:30:43 2011 +0200

    Merge branch 'master' into unittesting

commit 2e93b81172585e694c8dfdb4aa41a9272b90971e
Merge: 91709ec0c18074299b9e8560653018a9ff9206d3 fc5a9a6131f9bec3c7f8c91666f483b9487c1132
Author: Zarubin Stas <zarubin at zsv.org.ua>
Date:   Wed Jul 6 11:30:43 2011 +0300

    Merge remote-tracking branch 'upstream/unittesting'

commit 91709ec0c18074299b9e8560653018a9ff9206d3
Author: Zarubin Stas <zarubin at zsv.org.ua>
Date:   Wed Jul 6 10:47:10 2011 +0300

    New PHPUnit tests for common.lib.php

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |    3 +
 js/db_routines.js                                  |    4 +-
 js/functions.js                                    |    2 +-
 js/indexes.js                                      |   12 +-
 libraries/RecentTable.class.php                    |    4 +-
 libraries/common.lib.php                           |    4 +-
 libraries/header_meta_style.inc.php                |    7 +
 tbl_indexes.php                                    |   14 +-
 test/bootstrap-dist.php                            |    2 +
 test/libraries/common/PMA_ajaxResponse_test.php    |   71 ++
 .../libraries/common/PMA_browseUploadFile_test.php |   48 ++
 .../common/PMA_buildActionTitles_test.php          |   42 ++
 test/libraries/common/PMA_cache_test.php           |   14 +
 .../PMA_contains_nonprintable_ascii_test.php       |   37 +
 .../common/PMA_convert_bit_default_value_test.php  |   33 +
 .../common/PMA_displayMaximumUploadSize_test.php   |   41 ++
 .../common/PMA_display_html_checkbox_test.php      |   55 ++
 .../common/PMA_display_html_radio_test.php         |  188 +++++
 .../common/PMA_escapeMySqlWildcards_test.php       |    2 +
 .../PMA_extractValueFromFormattedSize_test.php     |   37 +
 .../common/PMA_foreignKeySupported_test.php        |    2 +
 .../common/PMA_formatNumberByteDown_test.php       |    5 +-
 test/libraries/common/PMA_formatSql_test.php       |  743 ++++++++++++++++++++
 .../common/PMA_generateHiddenMaxFileSize_test.php  |   40 +
 .../common/PMA_generate_html_dropdown_test.php     |   69 ++
 test/libraries/common/PMA_getIcon_test.php         |   74 ++
 .../common/PMA_getTitleForTarget_test.php          |   43 ++
 .../common/PMA_localisedDateTimespan_test.php      |    2 +-
 test/libraries/common/PMA_pow_test.php             |    2 +
 .../common/PMA_printableBitValue_test.php          |    1 +
 .../libraries/common/PMA_quoting_slashing_test.php |    7 +-
 .../common/PMA_showMessage_test_disabled.php       |   45 ++
 .../libraries/common/PMA_stringOperations_test.php |    1 +
 .../common/PMA_unsupportedDatatypes_test.php       |   32 +
 test/libraries/common/PMA_whichCrlf_test.php       |    1 +
 themes/original/jquery/jquery-ui-1.8.override.css  |    7 +
 themes/pmahomme/jquery/jquery-ui-1.8.override.css  |    7 +
 37 files changed, 1675 insertions(+), 26 deletions(-)
 create mode 100644 test/libraries/common/PMA_ajaxResponse_test.php
 create mode 100644 test/libraries/common/PMA_browseUploadFile_test.php
 create mode 100644 test/libraries/common/PMA_buildActionTitles_test.php
 create mode 100644 test/libraries/common/PMA_contains_nonprintable_ascii_test.php
 create mode 100644 test/libraries/common/PMA_convert_bit_default_value_test.php
 create mode 100644 test/libraries/common/PMA_displayMaximumUploadSize_test.php
 create mode 100644 test/libraries/common/PMA_display_html_checkbox_test.php
 create mode 100644 test/libraries/common/PMA_display_html_radio_test.php
 create mode 100644 test/libraries/common/PMA_extractValueFromFormattedSize_test.php
 create mode 100644 test/libraries/common/PMA_formatSql_test.php
 create mode 100644 test/libraries/common/PMA_generateHiddenMaxFileSize_test.php
 create mode 100644 test/libraries/common/PMA_generate_html_dropdown_test.php
 create mode 100644 test/libraries/common/PMA_getIcon_test.php
 create mode 100644 test/libraries/common/PMA_getTitleForTarget_test.php
 create mode 100644 test/libraries/common/PMA_showMessage_test_disabled.php
 create mode 100644 test/libraries/common/PMA_unsupportedDatatypes_test.php
 create mode 100644 themes/original/jquery/jquery-ui-1.8.override.css
 create mode 100644 themes/pmahomme/jquery/jquery-ui-1.8.override.css

diff --git a/ChangeLog b/ChangeLog
index 312e148..4ae25e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@ phpMyAdmin - ChangeLog
 + Display direction (horizontal/vertical) no longer displayed by default
 + Shift/click support in database Structure
 + Show/hide column in table Browse
+- bug #3353856 [AJAX] AJAX dialogs use wrong font-size
 
 3.4.4.0 (not yet released)
 - bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes
@@ -39,6 +40,8 @@ phpMyAdmin - ChangeLog
 - bug #3348995 [config] $cfg['Export']['asfile'] set to false does not select asText option
 - bug #3340151 [export] Working SQL query exports error page
 - bug #3353649 [interface] "Create an index on X columns" form not validated
+- bug #3350790 [interface] JS error in Table->Structure->Index->Edit
+- bug #3353811 [interface] Info message has "error" class
 
 3.4.3.1 (2011-07-02)
 - [security] Fixed possible session manipulation in swekey authentication, see PMASA-2011-5
diff --git a/js/db_routines.js b/js/db_routines.js
index 95254ca..ceb0962 100644
--- a/js/db_routines.js
+++ b/js/db_routines.js
@@ -308,7 +308,7 @@ $(document).ready(function() {
                 /**
                  * Display the dialog to the user
                  */
-                $ajaxDialog = $('<div style="font-size: 0.9em;">'+data.message+'</div>').dialog({
+                $ajaxDialog = $('<div>'+data.message+'</div>').dialog({
                                 width: 700,  // TODO: make a better decision about the size
                                 height: 550, // of the dialog based on the size of the viewport
                                 buttons: button_options,
@@ -529,7 +529,7 @@ $(document).ready(function() {
                     /**
                      * Display the dialog to the user
                      */
-                    $ajaxDialog = $('<div style="font-size: 0.9em;">'+data.message+'</div>').dialog({
+                    $ajaxDialog = $('<div>'+data.message+'</div>').dialog({
                                     width: 650,  // TODO: make a better decision about the size
                                                  // of the dialog based on the size of the viewport
                                     buttons: button_options,
diff --git a/js/functions.js b/js/functions.js
index e25ec98..9cdb44e 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -2445,7 +2445,7 @@ $(document).ready(function() {
                 /**
                  * Display the dialog to the user
                  */
-                var $ajaxDialog = $('<div style="font-size: 0.9em;">'+data.message+'</div>').dialog({
+                var $ajaxDialog = $('<div>'+data.message+'</div>').dialog({
                                       width: 500,
                                       buttons: button_options,
                                       title: data.title
diff --git a/js/indexes.js b/js/indexes.js
index 9b64d92..ef6f877 100644
--- a/js/indexes.js
+++ b/js/indexes.js
@@ -17,24 +17,24 @@ function checkIndexName()
     }
 
     // Gets the elements pointers
-    var the_idx_name = document.forms['index_frm'].elements['index'];
-    var the_idx_type = document.forms['index_frm'].elements['index_type'];
+    var the_idx_name = document.forms['index_frm'].elements['index[Key_name]'];
+    var the_idx_type = document.forms['index_frm'].elements['index[Index_type]'];
 
     // Index is a primary key
     if (the_idx_type.options[0].value == 'PRIMARY' && the_idx_type.options[0].selected) {
-        document.forms['index_frm'].elements['index'].value = 'PRIMARY';
+        document.forms['index_frm'].elements['index[Key_name]'].value = 'PRIMARY';
         if (typeof(the_idx_name.disabled) != 'undefined') {
-            document.forms['index_frm'].elements['index'].disabled = true;
+            document.forms['index_frm'].elements['index[Key_name]'].disabled = true;
         }
     }
 
     // Other cases
     else {
         if (the_idx_name.value == 'PRIMARY') {
-            document.forms['index_frm'].elements['index'].value = '';
+            document.forms['index_frm'].elements['index[Key_name]'].value = '';
         }
         if (typeof(the_idx_name.disabled) != 'undefined') {
-            document.forms['index_frm'].elements['index'].disabled = false;
+            document.forms['index_frm'].elements['index[Key_name]'].disabled = false;
         }
     }
 
diff --git a/libraries/RecentTable.class.php b/libraries/RecentTable.class.php
index f844bbc..bfb6081 100644
--- a/libraries/RecentTable.class.php
+++ b/libraries/RecentTable.class.php
@@ -142,7 +142,7 @@ class PMA_RecentTable
         $html = '<option value="">(' . __('Recent tables') . ') ...</option>';
         if (count($this->tables)) {
             foreach ($this->tables as $table) {
-                $html .= '<option value="' . $table . '">' . $table . '</option>';
+                $html .= '<option value="' . htmlspecialchars($table) . '">' . htmlspecialchars($table) . '</option>';
             }
         } else {
             $html .= '<option value="">' . __('There are no recent tables') . '</option>';
@@ -158,7 +158,7 @@ class PMA_RecentTable
     public function getHtmlSelect()
     {
         $html  = '<input type="hidden" name="goto" id="LeftDefaultTabTable" value="' .
-                         $GLOBALS['cfg']['LeftDefaultTabTable'] . '" />';
+                         htmlspecialchars($GLOBALS['cfg']['LeftDefaultTabTable']) . '" />';
         $html .= '<select name="table" id="recentTable">';
         $html .= $this->getHtmlSelectOption();
         $html .= '</select>';
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 61f3102..af4d3b2 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -2774,7 +2774,9 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
     header("Content-Type: application/json");
 
     echo json_encode($response);
-    exit;
+
+    if(!defined('TESTSUITE'))
+        exit;
 }
 
 /**
diff --git a/libraries/header_meta_style.inc.php b/libraries/header_meta_style.inc.php
index 5e5c533..e78b653 100644
--- a/libraries/header_meta_style.inc.php
+++ b/libraries/header_meta_style.inc.php
@@ -48,4 +48,11 @@ if ($GLOBALS['text_dir'] == 'ltr') {
     <link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : ''; ?>phpmyadmin.css.php<?php echo PMA_generate_common_url(array('server' => $GLOBALS['server'])); ?>&js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>&nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
     <link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : ''; ?>print.css" media="print" />
     <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['pmaThemePath']; ?>/jquery/jquery-ui-1.8.custom.css" />
+<?php
+    if (is_readable($GLOBALS['pmaThemePath'] . '/jquery/jquery-ui-1.8.override.css')) {
+?>
+    <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['pmaThemePath']; ?>/jquery/jquery-ui-1.8.override.css" />
+<?php
+    }
+?>
     <meta name="robots" content="noindex,nofollow" />
diff --git a/tbl_indexes.php b/tbl_indexes.php
index 995ee24..7e9bec6 100644
--- a/tbl_indexes.php
+++ b/tbl_indexes.php
@@ -140,8 +140,8 @@ if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) {
 ?>
 
 <form action="./tbl_indexes.php" method="post" name="index_frm" id="index_frm" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : ''); ?>
-    onsubmit="if (typeof(this.elements['index'].disabled) != 'undefined') {
-        this.elements['index'].disabled = false}">
+    onsubmit="if (typeof(this.elements['index[Key_name]'].disabled) != 'undefined') {
+        this.elements['index[Key_name]'].disabled = false}">
 <?php
 $form_params = array(
     'db'    => $db,
@@ -168,7 +168,9 @@ if (isset($_REQUEST['create_index'])) {
 }
 ?>
     </legend>
-
+<?php
+PMA_Message::notice(__('("PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!)'))->display();
+?>
 <div class="formelement">
 <label for="input_index_name"><?php echo __('Index name:'); ?></label>
 <input type="text" name="index[Key_name]" id="input_index_name" size="25"
@@ -183,11 +185,7 @@ if (isset($_REQUEST['create_index'])) {
 <?php echo PMA_showMySQLDocu('SQL-Syntax', 'ALTER_TABLE'); ?>
 </div>
 
-
-<br class="clearfloat" />
-<?php
-PMA_Message::error(__('("PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!)'))->display();
-?>
+<br class="clearfloat" /><br />
 
 <table id="index_columns">
 <thead>
diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php
index 366d104..fac9b27 100644
--- a/test/bootstrap-dist.php
+++ b/test/bootstrap-dist.php
@@ -7,6 +7,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(realpath("../inde
 define('PHPMYADMIN', 1);
 define('TESTSUITE', 1);
 
+session_start();
+
 // You can put some additional code that should run before tests here
 
 ?>
diff --git a/test/libraries/common/PMA_ajaxResponse_test.php b/test/libraries/common/PMA_ajaxResponse_test.php
new file mode 100644
index 0000000..9d5a842
--- /dev/null
+++ b/test/libraries/common/PMA_ajaxResponse_test.php
@@ -0,0 +1,71 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_ajaxResponse from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_ajaxResponse_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_ajaxResponse_test extends PHPUnit_Extensions_OutputTestCase
+{
+    function testAjaxResponseText()
+    {
+        $message = 'text';
+
+        $this->expectOutputString('{"success":true,"message":"' . $message . '"}');
+        PMA_ajaxResponse($message);
+    }
+
+    function testAjaxResponseTextWithExtra()
+    {
+        $message = 'text';
+        $exra = array('str_val' => 'te\x/t"1', 'int_val' => 10);
+
+        $this->expectOutputString('{"success":true,"message":"' . $message . '","str_val":"te\\\\x\/t\"1","int_val":10}');
+        PMA_ajaxResponse($message, true, $exra);
+    }
+
+    function testAjaxResponseTextError()
+    {
+        $message = 'error_text';
+
+        $this->expectOutputString('{"success":false,"error":"' . $message . '"}');
+        PMA_ajaxResponse($message, false);
+    }
+
+    function testAjaxResponseMessage()
+    {
+        $message = new PMA_Message("Message Text", 1);
+
+        $this->expectOutputString('{"success":true,"message":"<div class=\"success\">Message Text<\/div>"}');
+        PMA_ajaxResponse($message);
+    }
+
+    function testAjaxResponseMessageWithExtra()
+    {
+
+        $message = new PMA_Message("Message Text", 1);
+        $exra = array('str_val' => 'te\x/t"1', 'int_val' => 10);
+
+        $this->expectOutputString('{"success":true,"message":"<div class=\"success\">Message Text<\/div>","str_val":"te\\\\x\/t\"1","int_val":10}');
+        PMA_ajaxResponse($message, true, $exra);
+    }
+
+    function testAjaxResponseMessageError()
+    {
+
+        $message = new PMA_Message("Error Message Text", 1);
+
+        // TODO: class for output div should be "error"
+        $this->expectOutputString('{"success":false,"error":"<div class=\"success\">Error Message Text<\/div>"}');
+        PMA_ajaxResponse($message, false);
+    }
+
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_browseUploadFile_test.php b/test/libraries/common/PMA_browseUploadFile_test.php
new file mode 100644
index 0000000..45b8407
--- /dev/null
+++ b/test/libraries/common/PMA_browseUploadFile_test.php
@@ -0,0 +1,48 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_browseUploadFile from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_browseUploadFile_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_browseUploadFile_test extends PHPUnit_Extensions_OutputTestCase{
+
+    /*
+     * Data provider for test
+     */
+    public function dataProvider() {
+        return array(
+            array(10, __('B'), "10"),
+            array(100, __('B'), "100"),
+            array(1024, __('B'), "1,024"),
+            array(102400, __('KiB'), "100"),
+            array(10240000, __('MiB'), "10"),
+            array(2147483648, __('MiB'), "2,048"),
+            array(21474836480, __('GiB'), "20")
+        );
+    }
+
+    /**
+     * @dataProvider dataProvider
+     * @return void
+     */
+    function testBrowseUploadFile($size, $unit, $res){
+
+        $this->expectOutputString('<label for="radio_import_file">' . __("Browse your computer:") . '</label>'
+                                  . '<div id="upload_form_status" style="display: none;"></div>'
+                                  . '<div id="upload_form_status_info" style="display: none;"></div>'
+                                  . '<input type="file" name="import_file" id="input_import_file" />'
+                                  . "(" . __('Max: '). $res . $unit .")" . "\n"
+                                  . '<input type="hidden" name="MAX_FILE_SIZE" value="' .$size . '" />' . "\n");
+
+        PMA_browseUploadFile($size);
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_buildActionTitles_test.php b/test/libraries/common/PMA_buildActionTitles_test.php
new file mode 100644
index 0000000..130a972
--- /dev/null
+++ b/test/libraries/common/PMA_buildActionTitles_test.php
@@ -0,0 +1,42 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_buildActionTitles from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_buildActionTitles_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_buildActionTitles_test extends PHPUnit_Framework_TestCase{
+
+    function testBuildActionTitles(){
+        $titles = array();
+
+        $titles['Browse']     = PMA_getIcon('b_browse.png', __('Browse'), true);
+        $titles['NoBrowse']   = PMA_getIcon('bd_browse.png', __('Browse'), true);
+        $titles['Search']     = PMA_getIcon('b_select.png', __('Search'), true);
+        $titles['NoSearch']   = PMA_getIcon('bd_select.png', __('Search'), true);
+        $titles['Insert']     = PMA_getIcon('b_insrow.png', __('Insert'), true);
+        $titles['NoInsert']   = PMA_getIcon('bd_insrow.png', __('Insert'), true);
+        $titles['Structure']  = PMA_getIcon('b_props.png', __('Structure'), true);
+        $titles['Drop']       = PMA_getIcon('b_drop.png', __('Drop'), true);
+        $titles['NoDrop']     = PMA_getIcon('bd_drop.png', __('Drop'), true);
+        $titles['Empty']      = PMA_getIcon('b_empty.png', __('Empty'), true);
+        $titles['NoEmpty']    = PMA_getIcon('bd_empty.png', __('Empty'), true);
+        $titles['Edit']       = PMA_getIcon('b_edit.png', __('Edit'), true);
+        $titles['NoEdit']     = PMA_getIcon('bd_edit.png', __('Edit'), true);
+        $titles['Export']     = PMA_getIcon('b_export.png', __('Export'), true);
+        $titles['NoExport']   = PMA_getIcon('bd_export.png', __('Export'), true);
+        $titles['Execute']    = PMA_getIcon('b_nextpage.png', __('Execute'), true);
+        $titles['NoExecute']  = PMA_getIcon('bd_nextpage.png', __('Execute'), true);
+
+        $this->assertEquals($titles, PMA_buildActionTitles());
+
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_cache_test.php b/test/libraries/common/PMA_cache_test.php
index 9fd96a9..2284078 100644
--- a/test/libraries/common/PMA_cache_test.php
+++ b/test/libraries/common/PMA_cache_test.php
@@ -5,6 +5,7 @@
  *
  * @package phpMyAdmin-test
  * @version $Id: PMA_cache_test.php
+ * @group common.lib-tests
  */
 
 /*
@@ -90,5 +91,18 @@ class PMA_cache_test extends PHPUnit_Framework_TestCase
         PMA_cacheUnset('test_data_2', true);
         $this->assertArrayNotHasKey('test_data_2', $_SESSION['cache']['server_server']);
     }
+
+    /**
+     * Test clearing user cache
+     */
+    public function testClearUserCache()
+    {
+        $GLOBALS['server'] = 'server';
+        PMA_cacheSet('is_superuser', 'yes', true);
+        $this->assertEquals('yes', $_SESSION['cache']['server_server']['is_superuser']);
+
+        PMA_clearUserCache();
+        $this->assertArrayNotHasKey('is_superuser', $_SESSION['cache']['server_server']);
+    }
 }
 ?>
diff --git a/test/libraries/common/PMA_contains_nonprintable_ascii_test.php b/test/libraries/common/PMA_contains_nonprintable_ascii_test.php
new file mode 100644
index 0000000..8f4059e
--- /dev/null
+++ b/test/libraries/common/PMA_contains_nonprintable_ascii_test.php
@@ -0,0 +1,37 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_contains_nonprintable_ascii from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_contains_nonprintable_ascii.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_contains_nonprintable_ascii extends PHPUnit_Framework_TestCase{
+
+    function dataProvider(){
+        return array(
+            array("normal string", 0),
+            array("new\nline", 1),
+            array("tab\tspace", 1),
+            array("escape" . chr(27) . "char", 1),
+            array("chars%$\r\n",1),
+        );
+    }
+
+    /**
+     * @dataProvider dataProvider
+     */
+    function testContainsNonPrintableAscii($str, $res){
+        $this->assertEquals($res,PMA_contains_nonprintable_ascii($str));
+    }
+
+}
+
+// PMA_contains_nonprintable_ascii
\ No newline at end of file
diff --git a/test/libraries/common/PMA_convert_bit_default_value_test.php b/test/libraries/common/PMA_convert_bit_default_value_test.php
new file mode 100644
index 0000000..d54ab2d
--- /dev/null
+++ b/test/libraries/common/PMA_convert_bit_default_value_test.php
@@ -0,0 +1,33 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_convert_bit_default_value from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_convert_bit_default_value_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_convert_bit_default_value_test extends PHPUnit_Framework_TestCase{
+
+    function dataProvider(){
+        return array(
+            array("b'",""),
+            array("b'01'","01"),
+            array("b'010111010'","010111010")
+        );
+    }
+
+    /**
+     * @dataProvider dataProvider
+     */
+    function testConvert_bit_default_value_test($bit, $val){
+        $this->assertEquals($val, PMA_convert_bit_default_value($bit));
+        
+    }
+}
diff --git a/test/libraries/common/PMA_displayMaximumUploadSize_test.php b/test/libraries/common/PMA_displayMaximumUploadSize_test.php
new file mode 100644
index 0000000..ad93ddb
--- /dev/null
+++ b/test/libraries/common/PMA_displayMaximumUploadSize_test.php
@@ -0,0 +1,41 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_displayMaximumUploadSize from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_displayMaximumUploadSize_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_displayMaximumUploadSize_test extends PHPUnit_Framework_TestCase{
+
+    /*
+     * Data provider for test
+     */
+    public function dataProvider() {
+        return array(
+            array(10, __('B'), "10"),
+            array(100, __('B'), "100"),
+            array(1024, __('B'), "1,024"),
+            array(102400, __('KiB'), "100"),
+            array(10240000, __('MiB'), "10"),
+            array(2147483648, __('MiB'), "2,048"),
+            array(21474836480, __('GiB'), "20")
+        );
+    }
+
+    /**
+     * @dataProvider dataProvider
+     * @return void
+     */
+    function testMaximumUploadSize($size, $unit, $res){
+        $this->assertEquals("(" . __('Max: '). $res . $unit .")", PMA_displayMaximumUploadSize($size));
+
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_display_html_checkbox_test.php b/test/libraries/common/PMA_display_html_checkbox_test.php
new file mode 100644
index 0000000..c779d72
--- /dev/null
+++ b/test/libraries/common/PMA_display_html_checkbox_test.php
@@ -0,0 +1,55 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_display_html_checkbox from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_display_html_checkbox_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_display_html_checkbox_test extends PHPUnit_Extensions_OutputTestCase
+{
+    function testDisplayHtmlCheckbox()
+    {
+        $name = "test_display_html_checkbox";
+        $label = "text_label_for_checkbox";
+
+        $this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" /><label for="' . $name . '">' . $label . '</label>');
+        PMA_display_html_checkbox($name,$label,false,false);
+    }
+
+    function testDisplayHtmlCheckboxChecked()
+    {
+        $name = "test_display_html_checkbox";
+        $label = "text_label_for_checkbox";
+
+        $this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" /><label for="' . $name . '">' . $label . '</label>');
+        PMA_display_html_checkbox($name,$label,true,false);
+    }
+
+    function testDisplayHtmlCheckboxOnclick()
+    {
+        $name = "test_display_html_checkbox";
+        $label = "text_label_for_checkbox";
+
+        $this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" onclick="this.form.submit();" /><label for="' . $name . '">' . $label . '</label>');
+        PMA_display_html_checkbox($name,$label,false,true);
+    }
+
+    function testDisplayHtmlCheckboxCheckedOnclick()
+    {
+        $name = "test_display_html_checkbox";
+        $label = "text_label_for_checkbox";
+
+        $this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" onclick="this.form.submit();" /><label for="' . $name . '">' . $label . '</label>');
+        PMA_display_html_checkbox($name,$label,true,true);
+    }
+}
+ 
+//PMA_display_html_checkbox
\ No newline at end of file
diff --git a/test/libraries/common/PMA_display_html_radio_test.php b/test/libraries/common/PMA_display_html_radio_test.php
new file mode 100644
index 0000000..c5f2d4b
--- /dev/null
+++ b/test/libraries/common/PMA_display_html_radio_test.php
@@ -0,0 +1,188 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_display_html_radio from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_display_html_radio_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
+{
+    function testDisplayHtmlRadioEmpty()
+    {
+        $name = "test_display_radio";
+        $choices = array();
+
+        $this->expectOutputString("");
+        PMA_display_html_radio($name,$choices);
+    }
+
+    function testDisplayHtmlRadio()
+    {
+        $name = "test_display_radio";
+        $choices = array('value_1'=>'choice_1', 'value_2'=>'choice_2');
+
+        $out = "";
+        foreach ($choices as $choice_value => $choice_label) {
+            $html_field_id = $name . '_' . $choice_value;
+            $out .= '<input type="radio" name="' . $name . '" id="' . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+            $out .= ' />' . "\n";
+            $out .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
+            $out .= '<br />';
+            $out .= "\n";
+        }
+
+        $this->expectOutputString($out);
+        PMA_display_html_radio($name,$choices);
+    }
+
+    function testDisplayHtmlRadioWithChecked()
+    {
+        $name = "test_display_radio";
+        $choices = array('value_1'=>'choice_1', 'value_2'=>'choice_2');
+        $checked_choice = "value_2";
+
+        $out = "";
+        foreach ($choices as $choice_value => $choice_label) {
+            $html_field_id = $name . '_' . $choice_value;
+            $out .= '<input type="radio" name="' . $name . '" id="' . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+            if ($choice_value == $checked_choice) {
+                $out .= ' checked="checked"';
+            }
+            $out .= ' />' . "\n";
+            $out .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
+            $out .= '<br />';
+            $out .= "\n";
+        }
+
+        $this->expectOutputString($out);
+        PMA_display_html_radio($name,$choices,$checked_choice);
+    }
+
+    function testDisplayHtmlRadioWithCheckedWithClass()
+    {
+        $name = "test_display_radio";
+        $choices = array('value_1'=>'choice_1', 'value_2'=>'choice_2');
+        $checked_choice = "value_2";
+        $class = "test_class";
+
+        $out = "";
+        foreach ($choices as $choice_value => $choice_label) {
+            $html_field_id = $name . '_' . $choice_value;
+            $out .= '<div class="' . $class . '">';
+            $out .= '<input type="radio" name="' . $name . '" id="' . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+            if ($choice_value == $checked_choice) {
+                $out .= ' checked="checked"';
+            }
+            $out .= ' />' . "\n";
+            $out .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
+            $out .= '<br />';
+            $out .= '</div>';
+            $out .= "\n";
+        }
+
+        $this->expectOutputString($out);
+        PMA_display_html_radio($name,$choices,$checked_choice,true,false,$class);
+    }
+
+    function testDisplayHtmlRadioWithoutBR()
+    {
+        $name = "test_display_radio";
+        $choices = array('value_1'=>'choice_1', 'value&_<2>'=>'choice_2');
+        $checked_choice = "choice_2";
+
+        $out = "";
+        foreach ($choices as $choice_value => $choice_label) {
+            $html_field_id = $name . '_' . $choice_value;
+            $out .= '<input type="radio" name="' . $name . '" id="' . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+            if ($choice_value == $checked_choice) {
+                $out .= ' checked="checked"';
+            }
+            $out .= ' />' . "\n";
+            $out .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
+            $out .= "\n";
+        }
+
+        $this->expectOutputString($out);
+        PMA_display_html_radio($name,$choices,$checked_choice,false);
+    }
+
+    function testDisplayHtmlRadioEscapeLabelEscapeLabel()
+    {
+        $name = "test_display_radio";
+        $choices = array('value_1'=>'choice_1', 'value_&2'=>'choice&_<2>');
+        $checked_choice = "value_2";
+
+        $out = "";
+        foreach ($choices as $choice_value => $choice_label) {
+            $html_field_id = $name . '_' . $choice_value;
+            $out .= '<input type="radio" name="' . $name . '" id="' . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+            if ($choice_value == $checked_choice) {
+                $out .= ' checked="checked"';
+            }
+            $out .= ' />' . "\n";
+            $out .= '<label for="' . $html_field_id . '">' . htmlspecialchars($choice_label) . '</label>';
+            $out .= '<br />';
+            $out .= "\n";
+        }
+
+        $this->expectOutputString($out);
+        PMA_display_html_radio($name,$choices,$checked_choice,true,true);
+    }
+
+    function testDisplayHtmlRadioEscapeLabelNotEscapeLabel()
+    {
+        $name = "test_display_radio";
+        $choices = array('value_1'=>'choice_1', 'value_&2'=>'choice&_<2>');
+        $checked_choice = "value_2";
+
+        $out = "";
+        foreach ($choices as $choice_value => $choice_label) {
+            $html_field_id = $name . '_' . $choice_value;
+            $out .= '<input type="radio" name="' . $name . '" id="' . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+            if ($choice_value == $checked_choice) {
+                $out .= ' checked="checked"';
+            }
+            $out .= ' />' . "\n";
+            $out .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
+            $out .= '<br />';
+            $out .= "\n";
+        }
+
+        $this->expectOutputString($out);
+        PMA_display_html_radio($name,$choices,$checked_choice,true,false);
+    }
+
+    function testDisplayHtmlRadioEscapeLabelEscapeLabelWithClass()
+    {
+        $name = "test_display_radio";
+        $choices = array('value_1'=>'choice_1', 'value_&2'=>'choice&_<2>');
+        $checked_choice = "value_2";
+        $class = "test_class";
+
+        $out = "";
+        foreach ($choices as $choice_value => $choice_label) {
+            $html_field_id = $name . '_' . $choice_value;
+            $out .= '<div class="' . $class . '">';
+            $out .= '<input type="radio" name="' . $name . '" id="' . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+            if ($choice_value == $checked_choice) {
+                $out .= ' checked="checked"';
+            }
+            $out .= ' />' . "\n";
+            $out .= '<label for="' . $html_field_id . '">' . htmlspecialchars($choice_label) . '</label>';
+            $out .= '<br />';
+            $out .= '</div>';
+            $out .= "\n";
+        }
+
+        $this->expectOutputString($out);
+        PMA_display_html_radio($name,$choices,$checked_choice,true,true,$class);
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_escapeMySqlWildcards_test.php b/test/libraries/common/PMA_escapeMySqlWildcards_test.php
index 8a65356..c77a841 100644
--- a/test/libraries/common/PMA_escapeMySqlWildcards_test.php
+++ b/test/libraries/common/PMA_escapeMySqlWildcards_test.php
@@ -4,6 +4,8 @@
  * Test for MySQL Wildcards escaping/unescaping
  *
  * @package phpMyAdmin-test
+ * @version $Id: PMA_escapeMySqlWildcards_test.php
+ * @group common.lib-tests
  */
 
 /*
diff --git a/test/libraries/common/PMA_extractValueFromFormattedSize_test.php b/test/libraries/common/PMA_extractValueFromFormattedSize_test.php
new file mode 100644
index 0000000..038a36e
--- /dev/null
+++ b/test/libraries/common/PMA_extractValueFromFormattedSize_test.php
@@ -0,0 +1,37 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_extractValueFromFormattedSize from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_extractValueFromFormattedSize_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_extractValueFromFormattedSize_test extends PHPUnit_Framework_TestCase{
+
+    function testExtractValueFromFormattedSizeNoFormat(){
+
+        $this->assertEquals(-1,PMA_extractValueFromFormattedSize(100));
+    }
+
+    function testExtractValueFromFormattedSizeGB(){
+
+        $this->assertEquals(10737418240,PMA_extractValueFromFormattedSize("10GB"));
+    }
+
+    function testExtractValueFromFormattedSizeMB(){
+
+        $this->assertEquals(15728640,PMA_extractValueFromFormattedSize("15MB"));
+    }
+
+    function testExtractValueFromFormattedSizeK(){
+
+        $this->assertEquals(262144,PMA_extractValueFromFormattedSize("256K"));
+    }
+}
diff --git a/test/libraries/common/PMA_foreignKeySupported_test.php b/test/libraries/common/PMA_foreignKeySupported_test.php
index 8f02aa5..e0ebd2e 100644
--- a/test/libraries/common/PMA_foreignKeySupported_test.php
+++ b/test/libraries/common/PMA_foreignKeySupported_test.php
@@ -4,6 +4,8 @@
  * Test for supporting foreign key
  *
  * @package phpMyAdmin-test
+ * @version $Id: PMA_foreignKeySupported_test.php
+ * @group common.lib-tests
  */
 
 /*
diff --git a/test/libraries/common/PMA_formatNumberByteDown_test.php b/test/libraries/common/PMA_formatNumberByteDown_test.php
index ae0ce62..d800e1d 100644
--- a/test/libraries/common/PMA_formatNumberByteDown_test.php
+++ b/test/libraries/common/PMA_formatNumberByteDown_test.php
@@ -5,6 +5,7 @@
  *
  * @package phpMyAdmin-test
  * @version $Id: PMA_formatNumberByteDown_test.php
+ * @group common.lib-tests
  */
 
 /*
@@ -75,9 +76,9 @@ class PMA_formatNumberByteDown_test extends PHPUnit_Framework_TestCase
      */
     public function formatByteDownDataProvider() {
         return array(
-            array(10, 2, 2, array('10', 'B')),
+            array(10, 2, 2, array('10', __('B'))),
             array(100, 2, 0, array('0', __('KiB'))),
-            array(100, 3, 0, array('100', 'B')),
+            array(100, 3, 0, array('100', __('B'))),
             array(100, 2, 2, array('0.10', __('KiB'))),
             array(1034, 3, 2, array('1.01', __('KiB'))),
             array(100233, 3, 3, array('97.884', __('KiB'))),
diff --git a/test/libraries/common/PMA_formatSql_test.php b/test/libraries/common/PMA_formatSql_test.php
new file mode 100644
index 0000000..51e58a1
--- /dev/null
+++ b/test/libraries/common/PMA_formatSql_test.php
@@ -0,0 +1,743 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_formatSql from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_formatSql_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_formatSql_test extends PHPUnit_Framework_TestCase{
+
+    /**
+     * temporary variable for globals array
+     */
+    protected $tmpCfg;
+
+    /**
+     * temporary variable for session array
+     */
+    protected $tmpSession;
+
+    /**
+     * storing globals and session
+     */
+    public function setUp() {
+        global $cfg;
+        $this->tmpCfg = $cfg;
+    }
+
+    /**
+     * recovering globals and session
+     */
+    public function tearDown() {
+        global $cfg;
+        $cfg = $this->tmpCfg;
+    }
+
+    function testFormatSQLNotArray(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'html';
+        $sql = "SELECT * FROM tTable;";
+        $this->assertEquals("<pre>\n$sql\n</pre>",PMA_formatSql($sql));
+    }
+
+    function testFormatSQLfmTypeHtml_1(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'html';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $sql = array (
+          'raw' => 'SELECT 1;',
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'digit_integer',
+            'data' => '1',
+            'pos' => 8,
+          ),
+          2 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 3,
+        );
+        $unparsed = "SELECT 1;";
+        $expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a> <span class="syntax_digit syntax_digit_integer">1</span> <span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>';
+
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+    }
+
+    function testFormatSQLfmTypeHtml_2(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'html';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $unparsed = "SELECT * from `tTable`;";
+        $sql = array (
+          'raw' => $unparsed,
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'punct',
+            'data' => '*',
+            'pos' => 0,
+          ),
+          2 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'from',
+            'pos' => 13,
+            'forbidden' => true,
+          ),
+          3 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable`',
+            'pos' => 0,
+          ),
+          4 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 5,
+        );
+        $expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a>  <span class="syntax_punct">*</span> <br /><span class="syntax_alpha syntax_alpha_reservedWord">FROM</span>  <span class="syntax_quote syntax_quote_backtick">`tTable`</span> <span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>';
+
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+    }
+
+    function testFormatSQLfmTypeHtml_3(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'html';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $unparsed = 'SELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;';
+        $sql = array (
+          'raw' => $unparsed,
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'punct',
+            'data' => '*',
+            'pos' => 0,
+          ),
+          2 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'FROM',
+            'pos' => 13,
+            'forbidden' => true,
+          ),
+          3 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable_A`',
+            'pos' => 0,
+          ),
+          4 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'A',
+            'pos' => 26,
+            'forbidden' => false,
+          ),
+          5 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'INNER',
+            'pos' => 32,
+            'forbidden' => true,
+          ),
+          6 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'JOIN',
+            'pos' => 37,
+            'forbidden' => true,
+          ),
+          7 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable_B`',
+            'pos' => 0,
+          ),
+          8 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'B',
+            'pos' => 50,
+            'forbidden' => false,
+          ),
+          9 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'ON',
+            'pos' => 53,
+            'forbidden' => true,
+          ),
+          10 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'B',
+            'pos' => 55,
+            'forbidden' => false,
+          ),
+          11 =>
+          array (
+            'type' => 'punct_qualifier',
+            'data' => '.',
+            'pos' => 0,
+          ),
+          12 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'ID',
+            'pos' => 58,
+            'forbidden' => false,
+          ),
+          13 =>
+          array (
+            'type' => 'punct',
+            'data' => '=',
+            'pos' => 0,
+          ),
+          14 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'A',
+            'pos' => 62,
+            'forbidden' => false,
+          ),
+          15 =>
+          array (
+            'type' => 'punct_qualifier',
+            'data' => '.',
+            'pos' => 0,
+          ),
+          16 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'ID',
+            'pos' => 65,
+            'forbidden' => false,
+          ),
+          17 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 18,
+        );
+
+        $expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a>  <span class="syntax_punct">*</span> <br /><span class="syntax_alpha syntax_alpha_reservedWord">FROM</span>  <span class="syntax_quote syntax_quote_backtick">`tTable_A`</span> <span class="syntax_alpha syntax_alpha_identifier">A</span><br /><span class="syntax_alpha syntax_alpha_reservedWord">INNER</span>  <span class="syntax_alpha syntax_alpha_reservedWord">JOIN</span>  <span class="syntax_quote syntax_quote_backtick">`tTable_B`</span> <span class="syntax_alpha syntax_alpha_identifier">B</span> <span class="syntax_alpha syntax_alpha_reservedWord">ON</span> <span class="syntax_alpha syntax_alpha_identifier">B</span><span class="syntax_punct syntax_punct_qualifier">.</span><span class="syntax_alpha syntax_alpha_identifier">ID</span> <span class="syntax_punct">=</span></a> <span class="syntax_alpha syntax_alpha_identifier">A</span><span class="syntax_punct syntax_punct_qualifier">.</span><span class="syntax_alpha syntax_alpha_identifier">ID</span><span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>';
+
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+    }
+
+    function testFormatSQLfmTypeText_1(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'text';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $sql = array (
+          'raw' => 'SELECT 1;',
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'digit_integer',
+            'data' => '1',
+            'pos' => 8,
+          ),
+          2 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 3,
+        );
+        $unparsed = "SELECT 1;";
+        $expected = '<span class="inner_sql">SELECT</a> 1 ;<br /><br /></span>';
+
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+    }
+
+    function testFormatSQLfmTypeText_2(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'text';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $unparsed = "SELECT * from `tTable`;";
+        $sql = array (
+          'raw' => $unparsed,
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'punct',
+            'data' => '*',
+            'pos' => 0,
+          ),
+          2 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'from',
+            'pos' => 13,
+            'forbidden' => true,
+          ),
+          3 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable`',
+            'pos' => 0,
+          ),
+          4 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 5,
+        );
+        $expected = '<span class="inner_sql">SELECT</a>  * <br />FROM  `tTable` ;<br /><br /></span>';
+
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+    }
+
+    function testFormatSQLfmTypeText_3(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'text';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $unparsed = 'SELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;';
+        $sql = array (
+          'raw' => $unparsed,
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'punct',
+            'data' => '*',
+            'pos' => 0,
+          ),
+          2 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'FROM',
+            'pos' => 13,
+            'forbidden' => true,
+          ),
+          3 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable_A`',
+            'pos' => 0,
+          ),
+          4 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'A',
+            'pos' => 26,
+            'forbidden' => false,
+          ),
+          5 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'INNER',
+            'pos' => 32,
+            'forbidden' => true,
+          ),
+          6 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'JOIN',
+            'pos' => 37,
+            'forbidden' => true,
+          ),
+          7 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable_B`',
+            'pos' => 0,
+          ),
+          8 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'B',
+            'pos' => 50,
+            'forbidden' => false,
+          ),
+          9 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'ON',
+            'pos' => 53,
+            'forbidden' => true,
+          ),
+          10 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'B',
+            'pos' => 55,
+            'forbidden' => false,
+          ),
+          11 =>
+          array (
+            'type' => 'punct_qualifier',
+            'data' => '.',
+            'pos' => 0,
+          ),
+          12 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'ID',
+            'pos' => 58,
+            'forbidden' => false,
+          ),
+          13 =>
+          array (
+            'type' => 'punct',
+            'data' => '=',
+            'pos' => 0,
+          ),
+          14 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'A',
+            'pos' => 62,
+            'forbidden' => false,
+          ),
+          15 =>
+          array (
+            'type' => 'punct_qualifier',
+            'data' => '.',
+            'pos' => 0,
+          ),
+          16 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'ID',
+            'pos' => 65,
+            'forbidden' => false,
+          ),
+          17 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 18,
+        );
+        $expected = '<span class="inner_sql">SELECT</a>  * <br />FROM  `tTable_A` A<br />INNER  JOIN  `tTable_B` B ON B.ID =</a> A.ID;<br /><br /></span>';
+
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+    }
+
+    function testFormatSQLfmTypeNone_1(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'none';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $sql = array (
+          'raw' => 'SELECT 1;',
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'digit_integer',
+            'data' => '1',
+            'pos' => 8,
+          ),
+          2 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 3,
+        );
+        $unparsed = "SELECT 1;";
+
+        $expected = "<span class=\"inner_sql\"><pre>\nSELECT 1;\n</pre></span>";
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+
+        $expected = "SELECT 1;";
+        $this->assertEquals($expected,PMA_formatSql($sql));
+    }
+
+    function testFormatSQLfmTypeNone_2(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'none';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $unparsed = "SELECT * from `tTable`;";
+        $sql = array (
+          'raw' => $unparsed,
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'punct',
+            'data' => '*',
+            'pos' => 0,
+          ),
+          2 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'from',
+            'pos' => 13,
+            'forbidden' => true,
+          ),
+          3 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable`',
+            'pos' => 0,
+          ),
+          4 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 5,
+        );
+
+        $expected = "<span class=\"inner_sql\"><pre>\nSELECT * from `tTable`;\n</pre></span>";
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+
+        $expected = "SELECT * from `tTable`;";
+        $this->assertEquals($expected,PMA_formatSql($sql));
+    }
+
+    function testFormatSQLfmTypeNone_3(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = 'none';
+        $cfg['MySQLManualType'] = 'viewable';
+
+        $unparsed = 'SELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;';
+        $sql = array (
+          'raw' => $unparsed,
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'punct',
+            'data' => '*',
+            'pos' => 0,
+          ),
+          2 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'FROM',
+            'pos' => 13,
+            'forbidden' => true,
+          ),
+          3 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable_A`',
+            'pos' => 0,
+          ),
+          4 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'A',
+            'pos' => 26,
+            'forbidden' => false,
+          ),
+          5 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'INNER',
+            'pos' => 32,
+            'forbidden' => true,
+          ),
+          6 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'JOIN',
+            'pos' => 37,
+            'forbidden' => true,
+          ),
+          7 =>
+          array (
+            'type' => 'quote_backtick',
+            'data' => '`tTable_B`',
+            'pos' => 0,
+          ),
+          8 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'B',
+            'pos' => 50,
+            'forbidden' => false,
+          ),
+          9 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'ON',
+            'pos' => 53,
+            'forbidden' => true,
+          ),
+          10 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'B',
+            'pos' => 55,
+            'forbidden' => false,
+          ),
+          11 =>
+          array (
+            'type' => 'punct_qualifier',
+            'data' => '.',
+            'pos' => 0,
+          ),
+          12 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'ID',
+            'pos' => 58,
+            'forbidden' => false,
+          ),
+          13 =>
+          array (
+            'type' => 'punct',
+            'data' => '=',
+            'pos' => 0,
+          ),
+          14 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'A',
+            'pos' => 62,
+            'forbidden' => false,
+          ),
+          15 =>
+          array (
+            'type' => 'punct_qualifier',
+            'data' => '.',
+            'pos' => 0,
+          ),
+          16 =>
+          array (
+            'type' => 'alpha_identifier',
+            'data' => 'ID',
+            'pos' => 65,
+            'forbidden' => false,
+          ),
+          17 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 18,
+        );
+
+        $expected = "<span class=\"inner_sql\"><pre>\nSELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;\n</pre></span>";
+        $this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
+
+        $expected = 'SELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;';
+        $this->assertEquals($expected,PMA_formatSql($sql));
+    }
+
+    function testFormatSQLWithoutType(){
+        global $cfg;
+        $cfg['SQP']['fmtType'] = '';
+        $cfg['MySQLManualType'] = 'viewable';
+        $sql = array (
+          'raw' => 'SELECT 1;',
+          0 =>
+          array (
+            'type' => 'alpha_reservedWord',
+            'data' => 'SELECT',
+            'pos' => 6,
+            'forbidden' => true,
+          ),
+          1 =>
+          array (
+            'type' => 'digit_integer',
+            'data' => '1',
+            'pos' => 8,
+          ),
+          2 =>
+          array (
+            'type' => 'punct_queryend',
+            'data' => ';',
+            'pos' => 0,
+          ),
+          'len' => 3,
+        );
+        $this->assertEmpty(PMA_formatSql($sql));
+    }
+
+    function testFormatSQLError(){
+        global $SQP_errorString;
+        $SQP_errorString = true;
+        $sql = array("raw" => "& \" < >");
+        $this->assertEquals("& " < >",PMA_formatSql($sql));
+        $SQP_errorString = false;
+    }
+}
diff --git a/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php b/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php
new file mode 100644
index 0000000..3cd6810
--- /dev/null
+++ b/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php
@@ -0,0 +1,40 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_generateHiddenMaxFileSize from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_generateHiddenMaxFileSize_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_generateHiddenMaxFileSize_test extends PHPUnit_Framework_TestCase{
+
+    /*
+     * Data provider for test
+     */
+    public function dataProvider() {
+        return array(
+            array(10),
+            array("100"),
+            array(1024),
+            array("1024Mb"),
+            array(2147483648),
+            array("some_string")
+        );
+    }
+
+    /**
+     * @dataProvider dataProvider
+     * @return void
+     */
+    function test_generateHiddenMaxFileSize($size){
+        $this->assertEquals(PMA_generateHiddenMaxFileSize($size),
+                            '<input type="hidden" name="MAX_FILE_SIZE" value="' .$size . '" />');
+    }
+}
diff --git a/test/libraries/common/PMA_generate_html_dropdown_test.php b/test/libraries/common/PMA_generate_html_dropdown_test.php
new file mode 100644
index 0000000..8e27c20
--- /dev/null
+++ b/test/libraries/common/PMA_generate_html_dropdown_test.php
@@ -0,0 +1,69 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_generate_html_dropdown_test from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_display_html_checkbox_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase
+{
+    function testGenerateHtmlDropdownEmpty()
+    {
+        $name = "test_dropdown_name";
+        $choices = array();
+        $active_choice = null;
+        $id = "test_<dropdown>_name";
+
+        $result = '<select name="' . htmlspecialchars($name) . '" id="' . htmlspecialchars($id) . '"></select>';
+
+        $this->assertEquals($result, PMA_generate_html_dropdown($name,$choices,$active_choice,$id));
+    }
+
+    function testGenerateHtmlDropdown()
+    {
+        $name = "&test_dropdown_name";
+        $choices = array("value_1" => "label_1", "value&_2\"" => "label_2");
+        $active_choice = null;
+        $id = "test_<dropdown>_name";
+
+        $result = '<select name="' . htmlspecialchars($name) . '" id="' . htmlspecialchars($id) . '">';
+        foreach ($choices as $one_choice_value => $one_choice_label) {
+            $result .= '<option value="' . htmlspecialchars($one_choice_value) . '"';
+            if ($one_choice_value == $active_choice) {
+                $result .= ' selected="selected"';
+            }
+            $result .= '>' . htmlspecialchars($one_choice_label) . '</option>';
+        }
+        $result .= '</select>';
+
+        $this->assertEquals($result, PMA_generate_html_dropdown($name,$choices,$active_choice,$id));
+    }
+
+    function testGenerateHtmlDropdownWithActive()
+    {
+        $name = "&test_dropdown_name";
+        $choices = array("value_1" => "label_1", "value&_2\"" => "label_2");
+        $active_choice = "value&_2\"";
+        $id = "test_<dropdown>_name";
+
+        $result = '<select name="' . htmlspecialchars($name) . '" id="' . htmlspecialchars($id) . '">';
+        foreach ($choices as $one_choice_value => $one_choice_label) {
+            $result .= '<option value="' . htmlspecialchars($one_choice_value) . '"';
+            if ($one_choice_value == $active_choice) {
+                $result .= ' selected="selected"';
+            }
+            $result .= '>' . htmlspecialchars($one_choice_label) . '</option>';
+        }
+        $result .= '</select>';
+
+        $this->assertEquals($result, PMA_generate_html_dropdown($name,$choices,$active_choice,$id));
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_getIcon_test.php b/test/libraries/common/PMA_getIcon_test.php
new file mode 100644
index 0000000..7835aca
--- /dev/null
+++ b/test/libraries/common/PMA_getIcon_test.php
@@ -0,0 +1,74 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_getIcon() from common.lib.php
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_getIcon_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_getIcon_test extends PHPUnit_Framework_TestCase{
+
+    function testGetIconWithoutPropertiesIconic(){
+
+        $GLOBALS['cfg']['PropertiesIconic'] = false;
+        $GLOBALS['pmaThemeImage'] = 'theme/';
+
+        $this->assertEquals('<span class="nowrap"></span>',
+                            PMA_getIcon('b_comment.png') );
+    }
+
+    function testGetIconWithPropertiesIconic(){
+        
+        $GLOBALS['cfg']['PropertiesIconic'] = true;
+        $GLOBALS['pmaThemeImage'] = 'theme/';
+
+        $this->assertEquals('<span class="nowrap"><img src="'.$GLOBALS['pmaThemeImage']
+                            . 'b_comment.png" title="" alt="" class="icon" width="16" height="16" /></span>',
+                            PMA_getIcon('b_comment.png') );
+    }
+
+    function testGetIconAlternate(){
+
+        $GLOBALS['cfg']['PropertiesIconic'] = true;
+        $GLOBALS['pmaThemeImage'] = 'theme/';
+        $alternate_text = 'alt_str';
+
+        $this->assertEquals('<span class="nowrap"><img src="'.$GLOBALS['pmaThemeImage']
+                            .'b_comment.png" title="' . $alternate_text . '" alt="' . $alternate_text
+                            . '" class="icon" width="16" height="16" /></span>',
+                            PMA_getIcon('b_comment.png',$alternate_text) );
+    }
+
+    function testGetIconWithContainer(){
+
+        $GLOBALS['cfg']['PropertiesIconic'] = true;
+        $GLOBALS['pmaThemeImage'] = 'theme/';
+        $alternate_text = 'alt_str';
+
+        $this->assertEquals('<span class="nowrap"><img src="'.$GLOBALS['pmaThemeImage']
+                            .'b_comment.png" title="' . $alternate_text . '" alt="' . $alternate_text
+                            . '" class="icon" width="16" height="16" /></span>',
+                            PMA_getIcon('b_comment.png',$alternate_text, true) );
+
+    }
+
+    function testGetIconWithContainerAndForceText(){
+
+        $GLOBALS['cfg']['PropertiesIconic'] = true;
+        $GLOBALS['pmaThemeImage'] = 'theme/';
+        $alternate_text = 'alt_str';
+
+        $this->assertEquals('<span class="nowrap"><img src="'.$GLOBALS['pmaThemeImage']
+                            .'b_comment.png" title="' . $alternate_text . '" alt="' . $alternate_text
+                            . '" class="icon" width="16" height="16" /> ' . $alternate_text . '</span>',
+                            PMA_getIcon('b_comment.png',$alternate_text, true, true) );
+
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_getTitleForTarget_test.php b/test/libraries/common/PMA_getTitleForTarget_test.php
new file mode 100644
index 0000000..1756681
--- /dev/null
+++ b/test/libraries/common/PMA_getTitleForTarget_test.php
@@ -0,0 +1,43 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_getTitleForTarget from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_getTitleForTarget_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_getTitleForTarget_test extends PHPUnit_Framework_TestCase{
+
+    function dataProvider(){
+        return array(
+            array('tbl_structure.php', __('Structure')),
+            array('tbl_sql.php', __('SQL'),),
+            array('tbl_select.php', __('Search'),),
+            array('tbl_change.php', __('Insert')),
+            array('sql.php', __('Browse')),
+            array('db_structure.php', __('Structure')),
+            array('db_sql.php', __('SQL')),
+            array('db_search.php', __('Search')),
+            array('db_operations.php', __('Operations')),
+        );
+    }
+
+    /**
+     * @dataProvider dataProvider
+     * @return void
+     */
+    function testGetTitleForTarget($target, $result){
+
+        $this->assertEquals($result,PMA_getTitleForTarget($target));
+    }
+
+}
+ 
+//PMA_getTitleForTarget
\ No newline at end of file
diff --git a/test/libraries/common/PMA_localisedDateTimespan_test.php b/test/libraries/common/PMA_localisedDateTimespan_test.php
index 6443b65..7ec0364 100644
--- a/test/libraries/common/PMA_localisedDateTimespan_test.php
+++ b/test/libraries/common/PMA_localisedDateTimespan_test.php
@@ -5,13 +5,13 @@
  *
  * @package phpMyAdmin-test
  * @version $Id: PMA_localisedDateTimespan_test.php
+ * @group common.lib-tests
  */
 
 /*
  * Include to test.
  */
 require_once 'libraries/common.lib.php';
-require_once 'libraries/php-gettext/gettext.inc';
 
 class PMA_localisedDateTimespan_test extends PHPUnit_Framework_TestCase
 {
diff --git a/test/libraries/common/PMA_pow_test.php b/test/libraries/common/PMA_pow_test.php
index c37dd0d..ff55e16 100644
--- a/test/libraries/common/PMA_pow_test.php
+++ b/test/libraries/common/PMA_pow_test.php
@@ -4,6 +4,8 @@
  * Tests for PMA_pow() function from common.lib.php
  *
  * @package phpMyAdmin-test
+ * @version $Id: PMA_pow_test.php
+ * @group common.lib-tests
  */
 
 /*
diff --git a/test/libraries/common/PMA_printableBitValue_test.php b/test/libraries/common/PMA_printableBitValue_test.php
index 54ad1ff..d211981 100644
--- a/test/libraries/common/PMA_printableBitValue_test.php
+++ b/test/libraries/common/PMA_printableBitValue_test.php
@@ -5,6 +5,7 @@
  *
  * @package phpMyAdmin-test
  * @version $Id: PMA_printableBitValue_test.php
+ * @group common.lib-tests
  */
 
 /*
diff --git a/test/libraries/common/PMA_quoting_slashing_test.php b/test/libraries/common/PMA_quoting_slashing_test.php
index a6ee615..f63539f 100644
--- a/test/libraries/common/PMA_quoting_slashing_test.php
+++ b/test/libraries/common/PMA_quoting_slashing_test.php
@@ -5,12 +5,14 @@
  *
  * @package phpMyAdmin-test
  * @version $Id: PMA_quoting_slashing_test.php
+ * @group common.lib-tests
  */
 
 /*
  * Include to test.
  */
 require_once 'libraries/common.lib.php';
+require_once 'libraries/sqlparser.data.php';
 
 class PMA_quoting_slashing_test extends PHPUnit_Framework_TestCase
 {
@@ -88,9 +90,8 @@ class PMA_quoting_slashing_test extends PHPUnit_Framework_TestCase
      * @dataProvider backquoteDataProvider
      */
     public function testBackquote($a, $b) {
-        //$this->assertEquals($a, PMA_backquote($a, false));
-        //$this->assertEquals($b, PMA_backquote($a));
-        $this->markTestSkipped("Fix test for PMA_backquote() ");
+        $this->assertEquals($a, PMA_backquote($a, false));
+        $this->assertEquals($b, PMA_backquote($a));
     }
 }
 ?>
diff --git a/test/libraries/common/PMA_showMessage_test_disabled.php b/test/libraries/common/PMA_showMessage_test_disabled.php
new file mode 100644
index 0000000..7508564
--- /dev/null
+++ b/test/libraries/common/PMA_showMessage_test_disabled.php
@@ -0,0 +1,45 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_showMessage from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_showMessage_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+include 'libraries/core.lib.php';
+include 'libraries/vendor_config.php';
+include 'libraries/config.default.php';
+include 'libraries/database_interface.lib.php';
+include 'libraries/Table.class.php';
+require 'libraries/php-gettext/gettext.inc';
+
+class PMA_showMessage_test extends PHPUnit_Framework_TestCase
+{
+    protected $backupGlobals = FALSE;
+
+    function testShowMessageNotAjax(){
+//        global $cfg, $GLOBALS;
+
+//        $GLOBALS['sql_query'] = "SELECT * FROM tTable";
+//        $GLOBALS['table'] = 'tbl1';
+//        $cfg['SQP']['fmtType'] = 'none';
+//        $cfg['ShowTooltip'] = false;
+//        $cfg['ShowSQL'] = true;
+//        $cfg['MaxCharactersInDisplayedSQL'] = 1000;
+//
+//        print_r($cfg);
+
+        $GLOBALS['is_ajax_request'] = false;
+        $GLOBALS['db'] = 'db';
+        $GLOBALS['table'] = 'table';
+
+        $this->assertEquals("",PMA_showMessage("msg"));
+        $this->assertTrue(true);
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_stringOperations_test.php b/test/libraries/common/PMA_stringOperations_test.php
index 6af1748..f57a2b4 100644
--- a/test/libraries/common/PMA_stringOperations_test.php
+++ b/test/libraries/common/PMA_stringOperations_test.php
@@ -5,6 +5,7 @@
  *
  * @package phpMyAdmin-test
  * @version $Id: PMA_stringOperations_test.php
+ * @group common.lib-tests
  */
 
 /*
diff --git a/test/libraries/common/PMA_unsupportedDatatypes_test.php b/test/libraries/common/PMA_unsupportedDatatypes_test.php
new file mode 100644
index 0000000..686e4ee
--- /dev/null
+++ b/test/libraries/common/PMA_unsupportedDatatypes_test.php
@@ -0,0 +1,32 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for PMA_unsupportedDatatypes from common.lib
+ *
+ * @package phpMyAdmin-test
+ * @version $Id: PMA_unsupportedDatatypes_test.php
+ * @group common.lib-tests
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+
+class PMA_unsupportedDatatypes_test extends PHPUnit_Framework_TestCase
+{
+
+    function testNotSupportedDataTypes()
+    {
+        $no_support_types = array('geometry',
+                                  'point',
+                                  'linestring',
+                                  'polygon',
+                                  'multipoint',
+                                  'multilinestring',
+                                  'multipolygon',
+                                  'geometrycollection'
+        );
+        $this->assertEquals($no_support_types, PMA_unsupportedDatatypes());
+    }
+}
\ No newline at end of file
diff --git a/test/libraries/common/PMA_whichCrlf_test.php b/test/libraries/common/PMA_whichCrlf_test.php
index 6d8e25a..52d8323 100644
--- a/test/libraries/common/PMA_whichCrlf_test.php
+++ b/test/libraries/common/PMA_whichCrlf_test.php
@@ -5,6 +5,7 @@
  *
  * @package phpMyAdmin-test
  * @version $Id: PMA_whichCrlf_test.php
+ * @group common.lib-tests
  */
 
 /*
diff --git a/themes/original/jquery/jquery-ui-1.8.override.css b/themes/original/jquery/jquery-ui-1.8.override.css
new file mode 100644
index 0000000..4aee6fb
--- /dev/null
+++ b/themes/original/jquery/jquery-ui-1.8.override.css
@@ -0,0 +1,7 @@
+/**
+ * Use this file to override styles set by jquery-ui-1.8.custom.css
+ */
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-size: 1em; }
diff --git a/themes/pmahomme/jquery/jquery-ui-1.8.override.css b/themes/pmahomme/jquery/jquery-ui-1.8.override.css
new file mode 100644
index 0000000..4aee6fb
--- /dev/null
+++ b/themes/pmahomme/jquery/jquery-ui-1.8.override.css
@@ -0,0 +1,7 @@
+/**
+ * Use this file to override styles set by jquery-ui-1.8.custom.css
+ */
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-size: 1em; }


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list