From 2e26347e422bc64acedc0f11216e2bcd916dddef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 12 Jul 2013 15:04:19 +0200 Subject: [PATCH 01/32] Translated using Weblate (Uzbek) Currently translated at 49.5% (1291 of 2607) --- po/uz.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/uz.po b/po/uz.po index 5ae342cf85..0fec9a8972 100644 --- a/po/uz.po +++ b/po/uz.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.5-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-06-24 10:43+0200\n" -"PO-Revision-Date: 2013-04-25 15:48+0200\n" +"PO-Revision-Date: 2013-07-12 15:04+0200\n" "Last-Translator: Michal Čihař \n" "Language-Team: Uzbek \n" "Language: uz\n" @@ -105,7 +105,7 @@ msgid "" "for more information." msgstr "" "Ушбу тизимда %s файли мавжуд эмас, мархамат, қўшимча маълумотларни олиш учун " -"www.phpmyadmin.net сайтига ташриф буюринг" +"www.phpmyadmin.net сайтига ташриф буюринг." #: db_create.php:74 #, php-format From 65240d5c0cd030a7943e920c1f7463ab165da97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 12 Jul 2013 15:38:05 +0200 Subject: [PATCH 02/32] Translated using Weblate (Basque) Currently translated at 22.7% (592 of 2607) --- po/eu.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/eu.po b/po/eu.po index 3b62b09785..fbeb3ffcce 100644 --- a/po/eu.po +++ b/po/eu.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.5-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-06-24 10:43+0200\n" -"PO-Revision-Date: 2013-04-25 15:47+0200\n" +"PO-Revision-Date: 2013-07-12 15:38+0200\n" "Last-Translator: Michal Čihař \n" "Language-Team: Basque \n" "Language: eu\n" @@ -7798,7 +7798,7 @@ msgstr "" #: libraries/plugins/auth/AuthenticationCookie.class.php:201 msgid "Server:" -msgstr "Zerbitzaria" +msgstr "Zerbitzaria:" #: libraries/plugins/auth/AuthenticationCookie.class.php:213 msgid "Username:" From 0f766a837ec36d94cb9979a99cfbd0ab9d8ee64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 12 Jul 2013 15:45:48 +0200 Subject: [PATCH 03/32] Translated using Weblate (Breton) Currently translated at 26.4% (689 of 2607) --- po/br.po | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/po/br.po b/po/br.po index 868dc834a7..d7f38b724e 100644 --- a/po/br.po +++ b/po/br.po @@ -8,16 +8,15 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.5-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-06-24 10:43+0200\n" -"PO-Revision-Date: 2012-11-05 10:16+0200\n" +"PO-Revision-Date: 2013-07-12 15:45+0200\n" "Last-Translator: Michal Čihař \n" -"Language-Team: Breton \n" +"Language-Team: Breton \n" "Language: br\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 1.3-dev\n" +"X-Generator: Weblate 1.6-dev\n" #: browse_foreigners.php:51 browse_foreigners.php:75 js/messages.php:344 #: libraries/DisplayResults.class.php:813 @@ -901,7 +900,7 @@ msgstr "" #: js/messages.php:27 libraries/import.lib.php:118 sql.php:342 msgid "\"DROP DATABASE\" statements are disabled." -msgstr "Diweredekaet eo an urzhad ''DROP DATABASE'" +msgstr "Diweredekaet eo an urzhad ''DROP DATABASE'." #: js/messages.php:30 #, fuzzy, php-format @@ -1992,7 +1991,7 @@ msgstr "" #. l10n: Latest available phpMyAdmin version #: js/messages.php:381 msgid ", latest stable version:" -msgstr ", stumm stabil diwezhañ" +msgstr ", stumm stabil diwezhañ :" #: js/messages.php:382 msgid "up to date" @@ -2406,7 +2405,7 @@ msgstr "Kemmañ" #: libraries/DBQbe.class.php:1322 #, php-format msgid "SQL query on database %s:" -msgstr "Reked SQL ouzh an diaz roadennoù %s: " +msgstr "Reked SQL ouzh an diaz roadennoù %s :" #: libraries/DBQbe.class.php:1336 libraries/Util.class.php:1287 msgid "Submit Query" @@ -2477,7 +2476,7 @@ msgstr "Klask en diaz roadennoù" #: libraries/DbSearch.class.php:386 msgid "Words or values to search for (wildcard: \"%\"):" -msgstr "Gerioù pe dalvoudoù da glask (Joker: \"%\"):" +msgstr "Gerioù pe dalvoudoù da glask (Joker: \"%\") :" #: libraries/DbSearch.class.php:395 msgid "Find:" @@ -2489,7 +2488,7 @@ msgstr "Dispartiet e vez ar gerioù gant un esaouenn (\" \")." #: libraries/DbSearch.class.php:419 msgid "Inside tables:" -msgstr "E diabarzh an taolennoù" +msgstr "E diabarzh an taolennoù :" #: libraries/DbSearch.class.php:445 msgid "Inside column:" @@ -3723,7 +3722,7 @@ msgstr "Klikañ evit gwintañ" #: libraries/Util.class.php:3379 libraries/sql_query_form.lib.php:461 #: prefs_manage.php:242 msgid "Browse your computer:" -msgstr "Furchal en hoc'h urzhiataer" +msgstr "Furchal en hoc'h urzhiataer :" #: libraries/Util.class.php:3404 #, php-format @@ -3837,7 +3836,7 @@ msgstr "Anv ostiz direizh evit ar servijer %1$s. Gwiriit ar c'hefluniadur." #: libraries/common.inc.php:854 msgid "Invalid authentication method set in configuration:" -msgstr "Termenet ez eus bet c'hefluniadur un hentenn dilesa direizh." +msgstr "Termenet ez eus bet c'hefluniadur un hentenn dilesa direizh :" #: libraries/common.inc.php:976 #, php-format From 7873d84c709637689b36cec3125dd549b4c3289a Mon Sep 17 00:00:00 2001 From: Panagiotis Papazoglou Date: Mon, 15 Jul 2013 07:44:31 +0200 Subject: [PATCH 04/32] Translated using Weblate (Greek) Currently translated at 100.0% (2680 of 2680) --- po/el.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/el.po b/po/el.po index 3942904d67..ac63bf55aa 100644 --- a/po/el.po +++ b/po/el.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.1-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-07-12 16:06+0200\n" -"PO-Revision-Date: 2013-07-04 19:42+0200\n" +"PO-Revision-Date: 2013-07-15 07:44+0200\n" "Last-Translator: Panagiotis Papazoglou \n" "Language-Team: Greek \n" "Language: el\n" @@ -3312,10 +3312,9 @@ msgid "Reset zoom" msgstr "Επανφορά εστίασης" #: libraries/TableSearch.class.php:1281 -#, fuzzy #| msgid "Replace with" msgid "Replace with:" -msgstr "Αντικατάσταση με" +msgstr "Αντικατάσταση με:" #: libraries/TableSearch.class.php:1341 msgid "Find and replace - preview" From 493c23d18fdb926d3e46ed0d6a38eaa85891513b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 15 Jul 2013 10:42:02 +0200 Subject: [PATCH 05/32] Add shared code to setup header testing using runkit --- test/bootstrap-dist.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php index cfcacc3404..0edf05e329 100644 --- a/test/bootstrap-dist.php +++ b/test/bootstrap-dist.php @@ -34,4 +34,41 @@ $_SESSION[' PMA_token '] = 'token'; $GLOBALS['lang'] = 'en'; $GLOBALS['is_ajax_request'] = false; + +define('PMA_HAS_RUNKIT', function_exists('runkit_constant_redefine')); +$GLOBALS['runkit_internal_override'] = ini_get('runkit.internal_override'); + + +/** + * Function to emulate headers() function by storing headers in GLOBAL array. + */ +function test_header($string, $replace = true, $http_response_code = 200) +{ + if (! isset($GLOBALS['header'])) { + $GLOBALS['header'] = array(); + } + + $GLOBALS['header'][] = $string; +} + +/** + * Function to emulate headers_hest. + */ +function test_headers_sent() +{ + return false; +} + +if (PMA_HAS_RUNKIT && $GLOBALS['runkit_internal_override']) { + echo "Enabling headers testing...\n"; + runkit_function_rename('header', 'test_header_override'); + runkit_function_rename('headers_sent', 'test_headers_sent_override'); + runkit_function_rename('test_header', 'header'); + runkit_function_rename('test_headers_sent', 'headers_sent'); + define('PMA_TEST_HEADERS', true); +} else { + echo "No headers testing.\n"; + echo "Please install runkit and enable runkit.internal_override!\n"; +} + ?> From a2e9ee199ed449d7ed1792bc537a0df1428bfe39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 15 Jul 2013 10:42:41 +0200 Subject: [PATCH 06/32] Migrate PMA_sendHeaderLocation testing to shared header testing code --- .../core/PMA_headerLocation_test.php | 136 +++--------------- 1 file changed, 17 insertions(+), 119 deletions(-) diff --git a/test/libraries/core/PMA_headerLocation_test.php b/test/libraries/core/PMA_headerLocation_test.php index 61069caf6f..47d1127b50 100644 --- a/test/libraries/core/PMA_headerLocation_test.php +++ b/test/libraries/core/PMA_headerLocation_test.php @@ -50,110 +50,12 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase protected $runkitExt; protected $apdExt; - public function __construct() - { - parent::__construct(); - $this->runkitExt = false; - if (function_exists("runkit_constant_redefine")) { - $this->runkitExt = true; - } - - $this->apdExt = false; - if (function_exists("rename_function")) { - $this->apdExt = true; - } - - if ($this->apdExt && !$GLOBALS['test_header']) { - - /* - * using apd extension to overriding header and headers_sent - * functions for test purposes - */ - $GLOBALS['test_header'] = 1; - - /* - * rename_function() of header and headers_sent may cause CLI error - * report in Windows XP - */ - rename_function('header', 'test_header'); - rename_function('headers_sent', 'test_headers_sent'); - - /* - * solution from: - * http://unixwars.com/2008/11/29/override_function-in-php/ - * to overriding more than one function - */ - - $substs = array( - 'header' => - 'if (isset($GLOBALS["header"])) {' - . '$GLOBALS["header"] .= $a;' - . '} else {' - . '$GLOBALS["header"] = $a;' - . '}', - 'headers_sent' => 'return false;' - ); - - $args = array( - 'header' => '$a', - 'headers_sent' => '' - ); - - foreach ($substs as $func => $ren_func) { - if (function_exists("__overridden__")) { - rename_function( - "__overridden__", - str_replace( - array('.', ' '), - array('', ''), - microtime() - ) - ); - } - override_function($func, $args[$func], $substs[$func]); - rename_function( - "__overridden__", - str_replace(array('.', ' '), array('', ''), microtime()) - ); - } - - } - } - - public function __destruct() - { - /* - * rename_function may causes CLI error report in Windows XP, but - * nothing more happen - */ - - if ($this->apdExt && $GLOBALS['test_header']) { - $GLOBALS['test_header'] = 0; - - rename_function( - 'header', - 'header' . str_replace( - array('.', ' '), array('', ''), microtime() - ) - ); - rename_function( - 'headers_sent', - 'headers_sent' . str_replace( - array('.', ' '), array('', ''), microtime() - ) - ); - - rename_function('test_header', 'header'); - rename_function('test_headers_sent', 'headers_sent'); - } - } - public function setUp() { //session_start(); // cleaning constants - if ($this->runkitExt) { + if (PMA_HAS_RUNKIT) { $this->oldIISvalue = 'non-defined'; @@ -189,7 +91,7 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase //session_destroy(); // cleaning constants - if ($this->runkitExt) { + if (PMA_HAS_RUNKIT) { if ($this->oldIISvalue != 'non-defined') { runkit_constant_redefine('PMA_IS_IIS', $this->oldIISvalue); @@ -203,23 +105,19 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase runkit_constant_remove('SID'); } } - - if ($this->apdExt) { - unset($GLOBALS['header']); - } } public function testSendHeaderLocationWithSidUrlWithQuestionMark() { - if ($this->runkitExt && $this->apdExt) { + if (defined('PMA_TEST_HEADERS')) { runkit_constant_redefine('SID', md5('test_hash')); $testUri = 'http://testurl.com/test.php?test=test'; $separator = PMA_get_arg_separator(); - $header = 'Location: ' . $testUri . $separator . SID; + $header = array('Location: ' . $testUri . $separator . SID); /* sets $GLOBALS['header'] */ PMA_sendHeaderLocation($testUri); @@ -228,7 +126,7 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase } else { $this->markTestSkipped( - 'Cannot redefine constant/function - missing APD or/and runkit extension' + 'Cannot redefine constant/function - missing runkit extension' ); } @@ -236,74 +134,74 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase public function testSendHeaderLocationWithSidUrlWithoutQuestionMark() { - if ($this->runkitExt && $this->apdExt) { + if (defined('PMA_TEST_HEADERS')) { runkit_constant_redefine('SID', md5('test_hash')); $testUri = 'http://testurl.com/test.php'; $separator = PMA_get_arg_separator(); - $header = 'Location: ' . $testUri . '?' . SID; + $header = array('Location: ' . $testUri . '?' . SID); PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] $this->assertEquals($header, $GLOBALS['header']); } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); + $this->markTestSkipped('Cannot redefine constant/function - missing runkit extension'); } } public function testSendHeaderLocationWithoutSidWithIis() { - if ($this->runkitExt && $this->apdExt) { + if (defined('PMA_TEST_HEADERS')) { runkit_constant_redefine('PMA_IS_IIS', true); $testUri = 'http://testurl.com/test.php'; $separator = PMA_get_arg_separator(); - $header = 'Location: ' . $testUri; + $header = array('Location: ' . $testUri); PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] $this->assertEquals($header, $GLOBALS['header']); //reset $GLOBALS['header'] for the next assertion unset($GLOBALS['header']); - $header = 'Refresh: 0; ' . $testUri; + $header = array('Refresh: 0; ' . $testUri); PMA_sendHeaderLocation($testUri, true); // sets $GLOBALS['header'] $this->assertEquals($header, $GLOBALS['header']); } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); + $this->markTestSkipped('Cannot redefine constant/function - missing runkit extension'); } } public function testSendHeaderLocationWithoutSidWithoutIis() { - if ($this->apdExt) { + if (defined('PMA_TEST_HEADERS')) { $testUri = 'http://testurl.com/test.php'; - $header = 'Location: ' . $testUri; + $header = array('Location: ' . $testUri); PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] $this->assertEquals($header, $GLOBALS['header']); } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); + $this->markTestSkipped('Cannot redefine constant/function - missing runkit extension'); } } public function testSendHeaderLocationIisLongUri() { - if (defined('PMA_IS_IIS') && $this->runkitExt) { + if (defined('PMA_IS_IIS') && PMA_HAS_RUNKIT) { runkit_constant_redefine('PMA_IS_IIS', true); } elseif (!defined('PMA_IS_IIS')) { define('PMA_IS_IIS', true); } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); + $this->markTestSkipped('Cannot redefine constant/function - missing runkit extension'); } // over 600 chars From 870fc8b27dd871158aea4ebdc30254c07202d7a0 Mon Sep 17 00:00:00 2001 From: Panagiotis Papazoglou Date: Mon, 15 Jul 2013 07:46:54 +0200 Subject: [PATCH 07/32] Translated using Weblate (Greek) Currently translated at 100.0% (2680 of 2680) --- po/el.po | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/po/el.po b/po/el.po index ac63bf55aa..f57c72320d 100644 --- a/po/el.po +++ b/po/el.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.1-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-07-12 16:06+0200\n" -"PO-Revision-Date: 2013-07-15 07:44+0200\n" +"PO-Revision-Date: 2013-07-15 07:46+0200\n" "Last-Translator: Panagiotis Papazoglou \n" "Language-Team: Greek \n" "Language: el\n" @@ -1672,7 +1672,7 @@ msgstr "Προσθήκη %d τιμής(ών)" #: js/messages.php:259 msgid "" "Note: If the file contains multiple tables, they will be combined into one." -msgstr "Σημείωση: Αν το αρχείο περιέχει πολλούς πίνακες, θα ενωθουν σε έναν" +msgstr "Σημείωση: Αν το αρχείο περιέχει πολλούς πίνακες, θα ενωθουν σε έναν." #: js/messages.php:262 msgid "Hide query box" @@ -2849,7 +2849,7 @@ msgstr "Το πρωτεύον κλειδί διεγράφη" #: libraries/Index.class.php:608 #, php-format msgid "Index %s has been dropped." -msgstr "Το ευρετήριο %s διεγράφη" +msgstr "Το ευρετήριο %s έχει διαγραφεί." #: libraries/Index.class.php:731 #, php-format @@ -3826,8 +3826,7 @@ msgstr "Επιλογή από το φάκελο αποστολής του δια #: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183 #: libraries/sql_query_form.lib.php:483 msgid "The directory you set for upload work cannot be reached." -msgstr "" -"Ο υποκατάλογος που ορίσατε για την αποθήκευση αρχείων δεν μπόρεσε να βρεθεί" +msgstr "Ο φάκελος που ορίσατε για την αποθήκευση αρχείων δεν μπόρεσε να βρεθεί." #: libraries/Util.class.php:3452 msgid "There are no files to upload" @@ -8013,7 +8012,7 @@ msgstr "" msgid "No activity within %s seconds; please log in again." msgstr "" "Καμιά δραστηριότητα εδώ και %s δευτερόλεπτα τουλάχιστον, για αυτό " -"ξανασυνδεθείτε" +"ξανασυνδεθείτε." #: libraries/plugins/auth/AuthenticationCookie.class.php:667 #: libraries/plugins/auth/AuthenticationCookie.class.php:669 @@ -8037,7 +8036,7 @@ msgstr "Το αρχείο %s δεν περιέχει καμιά ταυτότητ #: libraries/plugins/auth/swekey/swekey.auth.lib.php:176 #: libraries/plugins/auth/swekey/swekey.auth.lib.php:196 msgid "Hardware authentication failed!" -msgstr "Η επικύρωση του υλικού απέτυχε" +msgstr "Η επικύρωση του υλικού απέτυχε!" #: libraries/plugins/auth/swekey/swekey.auth.lib.php:183 msgid "No valid authentication key plugged" @@ -11278,9 +11277,9 @@ msgid "" "There seems to be an error in your SQL query. The MySQL server error output " "below, if there is any, may also help you in diagnosing the problem." msgstr "" -"Φαίνεται να υπάρχει ένα λάθος στο ερώτημά σας. Το παρακάτω λάθος διακομιστή " -"MySQL, εάν υπάρχει κάποιο, μπορεί επίσης να σας βοηθήσει να διαγνώσετε το " -"πρόβλημα" +"Φαίνεται να υπάρχει ένα λάθος στο ερώτημά SQL σας. Το παρακάτω λάθος " +"διακομιστή MySQL, εάν υπάρχει κάποιο, μπορεί επίσης να σας βοηθήσει να " +"διαγνώσετε το πρόβλημα." #: libraries/sqlparser.lib.php:178 msgid "" From 574f520b1a7bc4ae0d94446789cfef51ec66e28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 15 Jul 2013 10:51:26 +0200 Subject: [PATCH 08/32] Use new shared runkit detection --- test/classes/config/PMA_FormDisplay_test.php | 60 +++++++++--------- test/libraries/PMA_ConfigFile_test.php | 6 +- test/libraries/PMA_FormDisplay_tpl_test.php | 66 ++++++++++---------- test/libraries/PMA_Index_test.php | 2 +- test/libraries/PMA_Tracker_test.php | 8 +-- test/libraries/PMA_mysql_charsets_test.php | 8 +-- test/libraries/PMA_user_preferences_test.php | 50 +++++++-------- test/libraries/common/PMA_whichCrlf_test.php | 11 ++-- 8 files changed, 105 insertions(+), 106 deletions(-) diff --git a/test/classes/config/PMA_FormDisplay_test.php b/test/classes/config/PMA_FormDisplay_test.php index 1e682b22de..51549eb6f9 100644 --- a/test/classes/config/PMA_FormDisplay_test.php +++ b/test/classes/config/PMA_FormDisplay_test.php @@ -41,7 +41,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ protected function tearDown() @@ -51,11 +51,11 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::__constructor - * + * * @return void */ public function testFormDisplayContructor() - { + { $this->assertCount( 5, $this->readAttribute($this->object, '_jsLangStrings') @@ -64,13 +64,13 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::registerForm - * + * * @return void */ public function testRegisterForm() { $reflection = new \ReflectionClass('FormDisplay'); - + $attrForms = $reflection->getProperty('_forms'); $attrForms->setAccessible(true); @@ -109,7 +109,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::process - * + * * @return void */ public function testProcess() @@ -145,13 +145,13 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::displayErrors - * + * * @return void */ public function testDisplayErrors() { $reflection = new \ReflectionClass('FormDisplay'); - + $attrIsValidated = $reflection->getProperty('_isValidated'); $attrIsValidated->setAccessible(true); $attrIsValidated->setValue($this->object, true); @@ -192,13 +192,13 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::fixErrors - * + * * @return void */ public function testFixErrors() { $reflection = new \ReflectionClass('FormDisplay'); - + $attrIsValidated = $reflection->getProperty('_isValidated'); $attrIsValidated->setAccessible(true); $attrIsValidated->setValue($this->object, true); @@ -228,7 +228,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase $attrIsValidated->setValue($this->object, $arr); $this->object->fixErrors(); - + $this->assertEquals( array( 'Servers' => array( @@ -243,17 +243,17 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::_validateSelect - * + * * @return void */ public function testValidateSelect() - { + { $attrValidateSelect = new \ReflectionMethod( 'FormDisplay', '_validateSelect' ); $attrValidateSelect->setAccessible(true); - + $arr = array('foo' => 'var'); $value = 'foo'; $this->assertTrue( @@ -284,7 +284,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase array(&$value, $arr) ) ); - + $arr = array('1' => 'foobar'); $value = 0; $this->assertFalse( @@ -297,7 +297,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::hasErrors - * + * * @return void */ public function testHasErrors() @@ -321,7 +321,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::getDocLink - * + * * @return void */ public function testGetDocLink() @@ -346,25 +346,25 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::getWikiLink - * + * * @return void */ public function testGetWikiLink() { $this->assertEquals( - "./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" . + "./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" . "AllowDeny.29&server=0&lang=en&token=token", $this->object->getWikiLink('Servers/1/AllowDeny') ); $this->assertEquals( - "./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" . + "./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" . "format_2&server=0&lang=en&token=token", $this->object->getWikiLink('Import/format') ); $this->assertEquals( - "./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" . + "./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" . "test&server=0&lang=en&token=token", $this->object->getWikiLink('Export/test') ); @@ -373,7 +373,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::_getOptName - * + * * @return void */ public function testGetOptName() @@ -394,14 +394,14 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::_loadUserprefsInfo - * + * * @return void */ public function testLoadUserprefsInfo() { $method = new \ReflectionMethod('FormDisplay', '_loadUserprefsInfo'); $method->setAccessible(true); - + $attrUserprefs = new \ReflectionProperty( 'FormDisplay', '_userprefsDisallow' @@ -417,12 +417,12 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase /** * Test for FormDisplay::_setComments - * + * * @return void */ public function testSetComments() { - if (!function_exists('runkit_constant_redefine')) { + if (! PMA_HAS_RUNKIT) { $this->markTestSkipped('Cannot redefine constant'); } @@ -447,11 +447,11 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase } if (!function_exists('recode_string')) { $expect['values']['recode'] .= " (unavailable)"; - $expect['comment'] .= ($expect['comment'] ? ", " : '') . + $expect['comment'] .= ($expect['comment'] ? ", " : '') . '"recode" requires recode extension'; } $expect['comment_warning'] = 1; - + $this->assertEquals( $expect, $opts @@ -531,7 +531,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase ); // SQLValidate - + $GLOBALS['cfg']['SQLValidator']['use'] = false; $method->invokeArgs( @@ -555,7 +555,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['MaxDbList'] = 10; $GLOBALS['cfg']['MaxTableList'] = 10; $GLOBALS['cfg']['QueryHistoryMax'] = 10; - + $method->invokeArgs( $this->object, array('MaxDbList', &$opts) diff --git a/test/libraries/PMA_ConfigFile_test.php b/test/libraries/PMA_ConfigFile_test.php index 3b6a3df098..096c8f6fa1 100644 --- a/test/libraries/PMA_ConfigFile_test.php +++ b/test/libraries/PMA_ConfigFile_test.php @@ -44,7 +44,7 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase unset($_SESSION[$this->readAttribute($this->object, "_id")]); unset($this->object); - + // reset the instance $attr_instance = new ReflectionProperty("ConfigFile", "_instance"); $attr_instance->setAccessible(true); @@ -58,7 +58,7 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase * @test */ public function testConfigFileConstructor() - { + { $attr_instance = new ReflectionProperty("ConfigFile", "_instance"); $attr_instance->setAccessible(true); $attr_instance->setValue(null, null); @@ -237,7 +237,7 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase */ public function testConfigFileSet() { - if (!function_exists("runkit_constant_redefine")) { + if (! PMA_HAS_RUNKIT) { $this->markTestSkipped("Cannot redefine constant"); } diff --git a/test/libraries/PMA_FormDisplay_tpl_test.php b/test/libraries/PMA_FormDisplay_tpl_test.php index 524c237d61..c9ddc07b80 100644 --- a/test/libraries/PMA_FormDisplay_tpl_test.php +++ b/test/libraries/PMA_FormDisplay_tpl_test.php @@ -24,10 +24,10 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase /** * Return the tag array to be used with assertTag by parsing * a given HTML element - * + * * @param string $elementHTML HTML for element to be parsed * @param array $arr Additional array elements like content, parent - * + * * @return array Tag array to be used with assertTag */ private function _getTagArray($elementHTML, $arr = array()) @@ -51,7 +51,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_displayFormTop() - * + * * @return void */ public function testDisplayFormTop() @@ -64,7 +64,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase $this->assertTag( $this->_getTagArray( - '
' ), $result @@ -109,7 +109,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_displayTabsTop() - * + * * @return void */ public function testDisplayTabsTop() @@ -141,7 +141,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_displayFieldsetTop() - * + * * @return void */ public function testDisplayFieldsetTop() @@ -214,12 +214,12 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_displayInput() - * + * * @return void */ public function testDisplayInput() - { - if (!function_exists('runkit_constant_remove')) { + { + if (! PMA_HAS_RUNKIT) { $this->markTestSkipped('Cannot modify constant'); } @@ -241,7 +241,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase 'desc', false, $opts ); $result = ob_get_clean(); - + $this->assertTag( $this->_getTagArray( '' @@ -338,9 +338,9 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase '
e1
', $result ); - + // second case - + define('PMA_SETUP', true); $GLOBALS['_FormDislayGroup'] = 0; $GLOBALS['cfg']['ThemePath'] = 'themePath'; @@ -351,7 +351,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase $opts['show_restore_default'] = true; $opts['userprefs_comment'] = 'userprefsComment'; $opts['userprefs_allow'] = true; - + ob_start(); PMA_displayInput( 'test/path', 'testName', 'checkbox', 'val', @@ -447,7 +447,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase ), $result ); - + // select case 1 $opts['values_escaped'] = true; $opts['values_disabled'] = array(1, 2); @@ -523,7 +523,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase '', true, $opts ); $result = ob_get_clean(); - + $this->assertTag( $this->_getTagArray( '