From 44df4a309475479af404506dbd77588acc424637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 7 Dec 2017 10:51:20 +0100 Subject: [PATCH 1/3] Force using POST for SQL query in Util::linkOrButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/Util.php | 1 + test/classes/DisplayResultsTest.php | 123 ++++++---------------------- 2 files changed, 26 insertions(+), 98 deletions(-) diff --git a/libraries/Util.php b/libraries/Util.php index bd6c051ed6..fbc944a59c 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -1822,6 +1822,7 @@ class Util if (($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) && $in_suhosin_limits && ! $force_button + && strpos($url, 'sql_query=') === false ) { $tag_params_strings = array(); foreach ($tag_params as $par_name => $par_value) { diff --git a/test/classes/DisplayResultsTest.php b/test/classes/DisplayResultsTest.php index 1704423b4a..0d3e8d0b53 100644 --- a/test/classes/DisplayResultsTest.php +++ b/test/classes/DisplayResultsTest.php @@ -372,6 +372,7 @@ class DisplayResultsTest extends PMATestCase array('`new`.`id`' => '= 1'), '[%_PMA_CHECKBOX_DIR_%]', 'klass', + ' Edit', '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', - '' - . '' - . ' Edit' - . '' + ' +Edit Edit +' ) ); } @@ -496,16 +490,9 @@ class DisplayResultsTest extends PMATestCase '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', 'klass', - '' - . ' Copy' - . '' + ' +Copy Copy +' ) ); } @@ -560,18 +547,9 @@ class DisplayResultsTest extends PMATestCase . 'alt="Delete" class="icon ic_b_drop" /> Delete', 'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1', 'klass', - '' - . 'Delete ' - . 'Delete' - . '
DELETE FROM `Data`.`customer` WHERE ' - . '`customer`.`id` = 1
' + ' +Delete Delete +
DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1
' ) ); } @@ -651,40 +629,14 @@ class DisplayResultsTest extends PMATestCase ' Delete', 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', - ' ' - . '' - . ' Edit' - . '' - . 'Copy Copy' - . '' - . 'Delete ' - . 'Delete' - . '
DELETE FROM `data`.`new` WHERE `new`.`id` = 1' - . '
' + ' +Edit Edit + +Copy Copy + +Delete Delete +
DELETE FROM `data`.`new` WHERE `new`.`id` = 1
' + ), array( PMA\libraries\DisplayResults::POSITION_RIGHT, @@ -723,38 +675,13 @@ class DisplayResultsTest extends PMATestCase ' Delete', 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', - '' - . 'Delete Delete' - . '
DELETE FROM `data`.`new` WHERE `new`.' - . '`id` = 1
' - . 'Copy Copy' - . '' - . '' - . 'Edit Edit' - . ' ' + ' +Delete Delete +
DELETE FROM `data`.`new` WHERE `new`.`id` = 1
+Copy Copy + +Edit Edit + ' ), array( PMA\libraries\DisplayResults::POSITION_NONE, From 8b8e68c6bf3867a7ccfc794326abf1bdcc8dbaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 18 Dec 2017 13:09:01 +0100 Subject: [PATCH 2/3] Use PSR-4 for loading selenium tests and adjust their names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- composer.json | 3 ++- test/selenium/PmaSeleniumChangePasswordTest.php | 4 ++-- test/selenium/PmaSeleniumCreateDropDatabaseTest.php | 4 ++-- test/selenium/PmaSeleniumCreateRemoveUserTest.php | 4 ++-- test/selenium/PmaSeleniumDbEventsTest.php | 4 ++-- test/selenium/PmaSeleniumDbOperationsTest.php | 5 ++--- test/selenium/PmaSeleniumDbProceduresTest.php | 4 ++-- test/selenium/PmaSeleniumDbStructureTest.php | 4 ++-- test/selenium/PmaSeleniumDbTriggersTest.php | 4 ++-- test/selenium/PmaSeleniumExportTest.php | 4 ++-- test/selenium/PmaSeleniumImportTest.php | 4 ++-- test/selenium/PmaSeleniumLoginTest.php | 4 ++-- test/selenium/PmaSeleniumNormalizationTest.php | 4 ++-- test/selenium/PmaSeleniumQueryByExampleTest.php | 4 ++-- test/selenium/PmaSeleniumServerSettingsTest.php | 4 ++-- test/selenium/PmaSeleniumSqlQueryTest.php | 4 ++-- test/selenium/PmaSeleniumTableBrowseTest.php | 4 ++-- test/selenium/PmaSeleniumTableCreateTest.php | 4 ++-- test/selenium/PmaSeleniumTableInsertTest.php | 4 ++-- test/selenium/PmaSeleniumTableOperationsTest.php | 4 ++-- test/selenium/PmaSeleniumTableStructureTest.php | 4 ++-- test/selenium/{TestBase.php => PmaSeleniumTestBase.php} | 3 ++- test/selenium/PmaSeleniumTrackingTest.php | 4 ++-- test/selenium/PmaSeleniumXssTest.php | 4 ++-- 24 files changed, 48 insertions(+), 47 deletions(-) rename test/selenium/{TestBase.php => PmaSeleniumTestBase.php} (99%) diff --git a/composer.json b/composer.json index 63d7b57d09..1a43ac0ada 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ }, "autoload-dev": { "psr-4": { - "PhpMyAdmin\\Tests\\": "test/classes" + "PhpMyAdmin\\Tests\\": "test/classes", + "PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/" } }, "repositories": [ diff --git a/test/selenium/PmaSeleniumChangePasswordTest.php b/test/selenium/PmaSeleniumChangePasswordTest.php index 2d00fe2000..c8bef05d36 100644 --- a/test/selenium/PmaSeleniumChangePasswordTest.php +++ b/test/selenium/PmaSeleniumChangePasswordTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumPrivilegesTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumChangePasswordTest extends PMA_SeleniumBase +class PmaSeleniumChangePasswordTest extends PmaSeleniumTestBase { /** * Tests the changing of the password diff --git a/test/selenium/PmaSeleniumCreateDropDatabaseTest.php b/test/selenium/PmaSeleniumCreateDropDatabaseTest.php index 3e10fe79ec..7535e2ff24 100644 --- a/test/selenium/PmaSeleniumCreateDropDatabaseTest.php +++ b/test/selenium/PmaSeleniumCreateDropDatabaseTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumCreateDropDatabaseTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumCreateDropDatabaseTest extends PMA_SeleniumBase +class PmaSeleniumCreateDropDatabaseTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumCreateRemoveUserTest.php b/test/selenium/PmaSeleniumCreateRemoveUserTest.php index f117b7177d..e54b6e6ca6 100644 --- a/test/selenium/PmaSeleniumCreateRemoveUserTest.php +++ b/test/selenium/PmaSeleniumCreateRemoveUserTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumCreateRemoveUserTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumCreateRemoveUserTest extends PMA_SeleniumBase +class PmaSeleniumCreateRemoveUserTest extends PmaSeleniumTestBase { /** * Username for the user diff --git a/test/selenium/PmaSeleniumDbEventsTest.php b/test/selenium/PmaSeleniumDbEventsTest.php index ff59f91d33..b479525aea 100644 --- a/test/selenium/PmaSeleniumDbEventsTest.php +++ b/test/selenium/PmaSeleniumDbEventsTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumDbEventsTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumDbEventsTest extends PMA_SeleniumBase +class PmaSeleniumDbEventsTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumDbOperationsTest.php b/test/selenium/PmaSeleniumDbOperationsTest.php index 825df88b51..2a841a9916 100644 --- a/test/selenium/PmaSeleniumDbOperationsTest.php +++ b/test/selenium/PmaSeleniumDbOperationsTest.php @@ -7,8 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; - +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumDbOperationsTest class @@ -17,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumDbOperationsTest extends PMA_SeleniumBase +class PmaSeleniumDbOperationsTest extends PmaSeleniumTestBase { /** * setUp function that can use the selenium session (called before each test) diff --git a/test/selenium/PmaSeleniumDbProceduresTest.php b/test/selenium/PmaSeleniumDbProceduresTest.php index 13858716c8..01bd88f194 100644 --- a/test/selenium/PmaSeleniumDbProceduresTest.php +++ b/test/selenium/PmaSeleniumDbProceduresTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumDbProceduresTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumDbProceduresTest extends PMA_SeleniumBase +class PmaSeleniumDbProceduresTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumDbStructureTest.php b/test/selenium/PmaSeleniumDbStructureTest.php index fe6cecb39b..050707b59a 100644 --- a/test/selenium/PmaSeleniumDbStructureTest.php +++ b/test/selenium/PmaSeleniumDbStructureTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumDbStructureTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumDbStructureTest extends PMA_SeleniumBase +class PmaSeleniumDbStructureTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumDbTriggersTest.php b/test/selenium/PmaSeleniumDbTriggersTest.php index 34772717ff..32c4605922 100644 --- a/test/selenium/PmaSeleniumDbTriggersTest.php +++ b/test/selenium/PmaSeleniumDbTriggersTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumDbTriggersTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumDbTriggersTest extends PMA_SeleniumBase +class PmaSeleniumDbTriggersTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumExportTest.php b/test/selenium/PmaSeleniumExportTest.php index c6d95a6f1a..028f66ef43 100644 --- a/test/selenium/PmaSeleniumExportTest.php +++ b/test/selenium/PmaSeleniumExportTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumExportTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumExportTest extends PMA_SeleniumBase +class PmaSeleniumExportTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumImportTest.php b/test/selenium/PmaSeleniumImportTest.php index edd717d322..fb3cecc4b9 100644 --- a/test/selenium/PmaSeleniumImportTest.php +++ b/test/selenium/PmaSeleniumImportTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumImportTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumImportTest extends PMA_SeleniumBase +class PmaSeleniumImportTest extends PmaSeleniumTestBase { /** * setUp function that can use the selenium session (called before each test) diff --git a/test/selenium/PmaSeleniumLoginTest.php b/test/selenium/PmaSeleniumLoginTest.php index 5417d31e25..4a0d70aa0a 100644 --- a/test/selenium/PmaSeleniumLoginTest.php +++ b/test/selenium/PmaSeleniumLoginTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumLoginTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumLoginTest extends PMA_SeleniumBase +class PmaSeleniumLoginTest extends PmaSeleniumTestBase { public function setUpPage() { diff --git a/test/selenium/PmaSeleniumNormalizationTest.php b/test/selenium/PmaSeleniumNormalizationTest.php index f3719482d4..e14fc81531 100644 --- a/test/selenium/PmaSeleniumNormalizationTest.php +++ b/test/selenium/PmaSeleniumNormalizationTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PMA_SeleniumNormalizationTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumNormalizationTest extends PMA_SeleniumBase +class PmaSeleniumNormalizationTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumQueryByExampleTest.php b/test/selenium/PmaSeleniumQueryByExampleTest.php index b545303ef1..3baa09bbec 100644 --- a/test/selenium/PmaSeleniumQueryByExampleTest.php +++ b/test/selenium/PmaSeleniumQueryByExampleTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumQueryByExampleTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PmaSeleniumQueryByExampleTest extends PMA_SeleniumBase +class PmaSeleniumQueryByExampleTest extends PmaSeleniumTestBase { /** diff --git a/test/selenium/PmaSeleniumServerSettingsTest.php b/test/selenium/PmaSeleniumServerSettingsTest.php index 97aa66a19f..af860f866b 100644 --- a/test/selenium/PmaSeleniumServerSettingsTest.php +++ b/test/selenium/PmaSeleniumServerSettingsTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumServerSettingsTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumSettingsTest extends PMA_SeleniumBase +class PmaSeleniumSettingsTest extends PmaSeleniumTestBase { /** * setUp function that can use the selenium session (called before each test) diff --git a/test/selenium/PmaSeleniumSqlQueryTest.php b/test/selenium/PmaSeleniumSqlQueryTest.php index 6e7599936d..1b2d1d2e1f 100644 --- a/test/selenium/PmaSeleniumSqlQueryTest.php +++ b/test/selenium/PmaSeleniumSqlQueryTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumSqlQueryTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumSqlQueryTest extends PMA_SeleniumBase +class PmaSeleniumSqlQueryTest extends PmaSeleniumTestBase { /** diff --git a/test/selenium/PmaSeleniumTableBrowseTest.php b/test/selenium/PmaSeleniumTableBrowseTest.php index 69473e004d..fe4172c8b4 100644 --- a/test/selenium/PmaSeleniumTableBrowseTest.php +++ b/test/selenium/PmaSeleniumTableBrowseTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumTableBrowseTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase +class PmaSeleniumTableBrowseTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumTableCreateTest.php b/test/selenium/PmaSeleniumTableCreateTest.php index 19634e6602..dbcf3448c3 100644 --- a/test/selenium/PmaSeleniumTableCreateTest.php +++ b/test/selenium/PmaSeleniumTableCreateTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumTableCreateTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumTableCreateTest extends PMA_SeleniumBase +class PmaSeleniumTableCreateTest extends PmaSeleniumTestBase { public function setUpPage() diff --git a/test/selenium/PmaSeleniumTableInsertTest.php b/test/selenium/PmaSeleniumTableInsertTest.php index d231df3072..6660b325d9 100644 --- a/test/selenium/PmaSeleniumTableInsertTest.php +++ b/test/selenium/PmaSeleniumTableInsertTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumTableInsertTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumTableInsertTest extends PMA_SeleniumBase +class PmaSeleniumTableInsertTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium t diff --git a/test/selenium/PmaSeleniumTableOperationsTest.php b/test/selenium/PmaSeleniumTableOperationsTest.php index a706c1447a..c175d83037 100644 --- a/test/selenium/PmaSeleniumTableOperationsTest.php +++ b/test/selenium/PmaSeleniumTableOperationsTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumTableOperationsTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumTableOperationsTest extends PMA_SeleniumBase +class PmaSeleniumTableOperationsTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumTableStructureTest.php b/test/selenium/PmaSeleniumTableStructureTest.php index c16f765643..1c937375fa 100644 --- a/test/selenium/PmaSeleniumTableStructureTest.php +++ b/test/selenium/PmaSeleniumTableStructureTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumTableStructureTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumTableStructureTest extends PMA_SeleniumBase +class PmaSeleniumTableStructureTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/TestBase.php b/test/selenium/PmaSeleniumTestBase.php similarity index 99% rename from test/selenium/TestBase.php rename to test/selenium/PmaSeleniumTestBase.php index 8aa0740d73..9afbc89552 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/PmaSeleniumTestBase.php @@ -6,6 +6,7 @@ * @package PhpMyAdmin-test * @subpackage Selenium */ +namespace PhpMyAdmin\Tests\Selenium; /** * Base class for Selenium tests. @@ -14,7 +15,7 @@ * @subpackage Selenium * @group selenium */ -abstract class PMA_SeleniumBase extends PHPUnit_Extensions_Selenium2TestCase +abstract class PmaSeleniumTestBase extends \PHPUnit_Extensions_Selenium2TestCase { /** * mysqli object diff --git a/test/selenium/PmaSeleniumTrackingTest.php b/test/selenium/PmaSeleniumTrackingTest.php index 415919d29a..323a8fa734 100644 --- a/test/selenium/PmaSeleniumTrackingTest.php +++ b/test/selenium/PmaSeleniumTrackingTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumTrackingTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumTrackingTest extends PMA_SeleniumBase +class PmaSeleniumTrackingTest extends PmaSeleniumTestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumXssTest.php b/test/selenium/PmaSeleniumXssTest.php index 95c94857c7..4736dc120e 100644 --- a/test/selenium/PmaSeleniumXssTest.php +++ b/test/selenium/PmaSeleniumXssTest.php @@ -7,7 +7,7 @@ * @subpackage Selenium */ -require_once 'TestBase.php'; +namespace PhpMyAdmin\Tests\Selenium; /** * PmaSeleniumXSSTest class @@ -16,7 +16,7 @@ require_once 'TestBase.php'; * @subpackage Selenium * @group selenium */ -class PMA_SeleniumXSSTest extends PMA_SeleniumBase +class PmaSeleniumXSSTest extends PmaSeleniumTestBase { public function setUpPage() { From 1957af5663bdc5d3745b327e6ed3310760f95bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 18 Dec 2017 13:10:38 +0100 Subject: [PATCH 3/3] Remove PmaSelenium prefix from Selenium tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is good enough to have Selenium in the namespace. Signed-off-by: Michal Čihař --- ...aSeleniumChangePasswordTest.php => ChangePasswordTest.php} | 4 ++-- ...mCreateDropDatabaseTest.php => CreateDropDatabaseTest.php} | 4 ++-- ...eniumCreateRemoveUserTest.php => CreateRemoveUserTest.php} | 4 ++-- .../{PmaSeleniumDbEventsTest.php => DbEventsTest.php} | 4 ++-- .../{PmaSeleniumDbOperationsTest.php => DbOperationsTest.php} | 4 ++-- .../{PmaSeleniumDbProceduresTest.php => DbProceduresTest.php} | 4 ++-- .../{PmaSeleniumDbStructureTest.php => DbStructureTest.php} | 4 ++-- .../{PmaSeleniumDbTriggersTest.php => DbTriggersTest.php} | 4 ++-- test/selenium/{PmaSeleniumExportTest.php => ExportTest.php} | 4 ++-- test/selenium/{PmaSeleniumImportTest.php => ImportTest.php} | 4 ++-- test/selenium/{PmaSeleniumLoginTest.php => LoginTest.php} | 4 ++-- ...PmaSeleniumNormalizationTest.php => NormalizationTest.php} | 2 +- ...aSeleniumQueryByExampleTest.php => QueryByExampleTest.php} | 4 ++-- ...aSeleniumServerSettingsTest.php => ServerSettingsTest.php} | 4 ++-- .../{PmaSeleniumSqlQueryTest.php => SqlQueryTest.php} | 4 ++-- .../{PmaSeleniumTableBrowseTest.php => TableBrowseTest.php} | 4 ++-- .../{PmaSeleniumTableCreateTest.php => TableCreateTest.php} | 4 ++-- .../{PmaSeleniumTableInsertTest.php => TableInsertTest.php} | 4 ++-- ...eleniumTableOperationsTest.php => TableOperationsTest.php} | 4 ++-- ...aSeleniumTableStructureTest.php => TableStructureTest.php} | 4 ++-- test/selenium/{PmaSeleniumTestBase.php => TestBase.php} | 2 +- .../{PmaSeleniumTrackingTest.php => TrackingTest.php} | 4 ++-- test/selenium/{PmaSeleniumXssTest.php => XssTest.php} | 4 ++-- 23 files changed, 44 insertions(+), 44 deletions(-) rename test/selenium/{PmaSeleniumChangePasswordTest.php => ChangePasswordTest.php} (96%) rename test/selenium/{PmaSeleniumCreateDropDatabaseTest.php => CreateDropDatabaseTest.php} (95%) rename test/selenium/{PmaSeleniumCreateRemoveUserTest.php => CreateRemoveUserTest.php} (97%) rename test/selenium/{PmaSeleniumDbEventsTest.php => DbEventsTest.php} (98%) rename test/selenium/{PmaSeleniumDbOperationsTest.php => DbOperationsTest.php} (97%) rename test/selenium/{PmaSeleniumDbProceduresTest.php => DbProceduresTest.php} (98%) rename test/selenium/{PmaSeleniumDbStructureTest.php => DbStructureTest.php} (96%) rename test/selenium/{PmaSeleniumDbTriggersTest.php => DbTriggersTest.php} (98%) rename test/selenium/{PmaSeleniumExportTest.php => ExportTest.php} (98%) rename test/selenium/{PmaSeleniumImportTest.php => ImportTest.php} (97%) rename test/selenium/{PmaSeleniumLoginTest.php => LoginTest.php} (92%) rename test/selenium/{PmaSeleniumNormalizationTest.php => NormalizationTest.php} (98%) rename test/selenium/{PmaSeleniumQueryByExampleTest.php => QueryByExampleTest.php} (98%) rename test/selenium/{PmaSeleniumServerSettingsTest.php => ServerSettingsTest.php} (97%) rename test/selenium/{PmaSeleniumSqlQueryTest.php => SqlQueryTest.php} (98%) rename test/selenium/{PmaSeleniumTableBrowseTest.php => TableBrowseTest.php} (98%) rename test/selenium/{PmaSeleniumTableCreateTest.php => TableCreateTest.php} (98%) rename test/selenium/{PmaSeleniumTableInsertTest.php => TableInsertTest.php} (97%) rename test/selenium/{PmaSeleniumTableOperationsTest.php => TableOperationsTest.php} (98%) rename test/selenium/{PmaSeleniumTableStructureTest.php => TableStructureTest.php} (97%) rename test/selenium/{PmaSeleniumTestBase.php => TestBase.php} (99%) rename test/selenium/{PmaSeleniumTrackingTest.php => TrackingTest.php} (98%) rename test/selenium/{PmaSeleniumXssTest.php => XssTest.php} (92%) diff --git a/test/selenium/PmaSeleniumChangePasswordTest.php b/test/selenium/ChangePasswordTest.php similarity index 96% rename from test/selenium/PmaSeleniumChangePasswordTest.php rename to test/selenium/ChangePasswordTest.php index c8bef05d36..aea07b71b4 100644 --- a/test/selenium/PmaSeleniumChangePasswordTest.php +++ b/test/selenium/ChangePasswordTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumPrivilegesTest class + * PrivilegesTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumChangePasswordTest extends PmaSeleniumTestBase +class ChangePasswordTest extends TestBase { /** * Tests the changing of the password diff --git a/test/selenium/PmaSeleniumCreateDropDatabaseTest.php b/test/selenium/CreateDropDatabaseTest.php similarity index 95% rename from test/selenium/PmaSeleniumCreateDropDatabaseTest.php rename to test/selenium/CreateDropDatabaseTest.php index 7535e2ff24..6fe2dc6727 100644 --- a/test/selenium/PmaSeleniumCreateDropDatabaseTest.php +++ b/test/selenium/CreateDropDatabaseTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumCreateDropDatabaseTest class + * CreateDropDatabaseTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumCreateDropDatabaseTest extends PmaSeleniumTestBase +class CreateDropDatabaseTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumCreateRemoveUserTest.php b/test/selenium/CreateRemoveUserTest.php similarity index 97% rename from test/selenium/PmaSeleniumCreateRemoveUserTest.php rename to test/selenium/CreateRemoveUserTest.php index e54b6e6ca6..86fba66674 100644 --- a/test/selenium/PmaSeleniumCreateRemoveUserTest.php +++ b/test/selenium/CreateRemoveUserTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumCreateRemoveUserTest class + * CreateRemoveUserTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumCreateRemoveUserTest extends PmaSeleniumTestBase +class CreateRemoveUserTest extends TestBase { /** * Username for the user diff --git a/test/selenium/PmaSeleniumDbEventsTest.php b/test/selenium/DbEventsTest.php similarity index 98% rename from test/selenium/PmaSeleniumDbEventsTest.php rename to test/selenium/DbEventsTest.php index b479525aea..37f767bb3c 100644 --- a/test/selenium/PmaSeleniumDbEventsTest.php +++ b/test/selenium/DbEventsTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumDbEventsTest class + * DbEventsTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumDbEventsTest extends PmaSeleniumTestBase +class DbEventsTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumDbOperationsTest.php b/test/selenium/DbOperationsTest.php similarity index 97% rename from test/selenium/PmaSeleniumDbOperationsTest.php rename to test/selenium/DbOperationsTest.php index 2a841a9916..e419baa042 100644 --- a/test/selenium/PmaSeleniumDbOperationsTest.php +++ b/test/selenium/DbOperationsTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumDbOperationsTest class + * DbOperationsTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumDbOperationsTest extends PmaSeleniumTestBase +class DbOperationsTest extends TestBase { /** * setUp function that can use the selenium session (called before each test) diff --git a/test/selenium/PmaSeleniumDbProceduresTest.php b/test/selenium/DbProceduresTest.php similarity index 98% rename from test/selenium/PmaSeleniumDbProceduresTest.php rename to test/selenium/DbProceduresTest.php index 01bd88f194..bf55326834 100644 --- a/test/selenium/PmaSeleniumDbProceduresTest.php +++ b/test/selenium/DbProceduresTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumDbProceduresTest class + * DbProceduresTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumDbProceduresTest extends PmaSeleniumTestBase +class DbProceduresTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumDbStructureTest.php b/test/selenium/DbStructureTest.php similarity index 96% rename from test/selenium/PmaSeleniumDbStructureTest.php rename to test/selenium/DbStructureTest.php index 050707b59a..96bbd4925c 100644 --- a/test/selenium/PmaSeleniumDbStructureTest.php +++ b/test/selenium/DbStructureTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumDbStructureTest class + * DbStructureTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumDbStructureTest extends PmaSeleniumTestBase +class DbStructureTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumDbTriggersTest.php b/test/selenium/DbTriggersTest.php similarity index 98% rename from test/selenium/PmaSeleniumDbTriggersTest.php rename to test/selenium/DbTriggersTest.php index 32c4605922..830e2eb1c5 100644 --- a/test/selenium/PmaSeleniumDbTriggersTest.php +++ b/test/selenium/DbTriggersTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumDbTriggersTest class + * DbTriggersTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumDbTriggersTest extends PmaSeleniumTestBase +class DbTriggersTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumExportTest.php b/test/selenium/ExportTest.php similarity index 98% rename from test/selenium/PmaSeleniumExportTest.php rename to test/selenium/ExportTest.php index 028f66ef43..214c0e6d90 100644 --- a/test/selenium/PmaSeleniumExportTest.php +++ b/test/selenium/ExportTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumExportTest class + * ExportTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumExportTest extends PmaSeleniumTestBase +class ExportTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumImportTest.php b/test/selenium/ImportTest.php similarity index 97% rename from test/selenium/PmaSeleniumImportTest.php rename to test/selenium/ImportTest.php index fb3cecc4b9..3412fb7f0f 100644 --- a/test/selenium/PmaSeleniumImportTest.php +++ b/test/selenium/ImportTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumImportTest class + * ImportTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumImportTest extends PmaSeleniumTestBase +class ImportTest extends TestBase { /** * setUp function that can use the selenium session (called before each test) diff --git a/test/selenium/PmaSeleniumLoginTest.php b/test/selenium/LoginTest.php similarity index 92% rename from test/selenium/PmaSeleniumLoginTest.php rename to test/selenium/LoginTest.php index 4a0d70aa0a..a33b35878d 100644 --- a/test/selenium/PmaSeleniumLoginTest.php +++ b/test/selenium/LoginTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumLoginTest class + * LoginTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumLoginTest extends PmaSeleniumTestBase +class LoginTest extends TestBase { public function setUpPage() { diff --git a/test/selenium/PmaSeleniumNormalizationTest.php b/test/selenium/NormalizationTest.php similarity index 98% rename from test/selenium/PmaSeleniumNormalizationTest.php rename to test/selenium/NormalizationTest.php index e14fc81531..509497ef59 100644 --- a/test/selenium/PmaSeleniumNormalizationTest.php +++ b/test/selenium/NormalizationTest.php @@ -16,7 +16,7 @@ namespace PhpMyAdmin\Tests\Selenium; * @subpackage Selenium * @group selenium */ -class PmaSeleniumNormalizationTest extends PmaSeleniumTestBase +class NormalizationTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumQueryByExampleTest.php b/test/selenium/QueryByExampleTest.php similarity index 98% rename from test/selenium/PmaSeleniumQueryByExampleTest.php rename to test/selenium/QueryByExampleTest.php index 3baa09bbec..e74b0b885c 100644 --- a/test/selenium/PmaSeleniumQueryByExampleTest.php +++ b/test/selenium/QueryByExampleTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumQueryByExampleTest class + * QueryByExampleTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumQueryByExampleTest extends PmaSeleniumTestBase +class QueryByExampleTest extends TestBase { /** diff --git a/test/selenium/PmaSeleniumServerSettingsTest.php b/test/selenium/ServerSettingsTest.php similarity index 97% rename from test/selenium/PmaSeleniumServerSettingsTest.php rename to test/selenium/ServerSettingsTest.php index af860f866b..bb95b706e3 100644 --- a/test/selenium/PmaSeleniumServerSettingsTest.php +++ b/test/selenium/ServerSettingsTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumServerSettingsTest class + * ServerSettingsTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumSettingsTest extends PmaSeleniumTestBase +class SettingsTest extends TestBase { /** * setUp function that can use the selenium session (called before each test) diff --git a/test/selenium/PmaSeleniumSqlQueryTest.php b/test/selenium/SqlQueryTest.php similarity index 98% rename from test/selenium/PmaSeleniumSqlQueryTest.php rename to test/selenium/SqlQueryTest.php index 1b2d1d2e1f..f258b9b1db 100644 --- a/test/selenium/PmaSeleniumSqlQueryTest.php +++ b/test/selenium/SqlQueryTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumSqlQueryTest class + * SqlQueryTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumSqlQueryTest extends PmaSeleniumTestBase +class SqlQueryTest extends TestBase { /** diff --git a/test/selenium/PmaSeleniumTableBrowseTest.php b/test/selenium/TableBrowseTest.php similarity index 98% rename from test/selenium/PmaSeleniumTableBrowseTest.php rename to test/selenium/TableBrowseTest.php index fe4172c8b4..f0b55a8564 100644 --- a/test/selenium/PmaSeleniumTableBrowseTest.php +++ b/test/selenium/TableBrowseTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumTableBrowseTest class + * TableBrowseTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumTableBrowseTest extends PmaSeleniumTestBase +class TableBrowseTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumTableCreateTest.php b/test/selenium/TableCreateTest.php similarity index 98% rename from test/selenium/PmaSeleniumTableCreateTest.php rename to test/selenium/TableCreateTest.php index dbcf3448c3..ad3f62265a 100644 --- a/test/selenium/PmaSeleniumTableCreateTest.php +++ b/test/selenium/TableCreateTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumTableCreateTest class + * TableCreateTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumTableCreateTest extends PmaSeleniumTestBase +class TableCreateTest extends TestBase { public function setUpPage() diff --git a/test/selenium/PmaSeleniumTableInsertTest.php b/test/selenium/TableInsertTest.php similarity index 97% rename from test/selenium/PmaSeleniumTableInsertTest.php rename to test/selenium/TableInsertTest.php index 6660b325d9..e31191da34 100644 --- a/test/selenium/PmaSeleniumTableInsertTest.php +++ b/test/selenium/TableInsertTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumTableInsertTest class + * TableInsertTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumTableInsertTest extends PmaSeleniumTestBase +class TableInsertTest extends TestBase { /** * Setup the browser environment to run the selenium t diff --git a/test/selenium/PmaSeleniumTableOperationsTest.php b/test/selenium/TableOperationsTest.php similarity index 98% rename from test/selenium/PmaSeleniumTableOperationsTest.php rename to test/selenium/TableOperationsTest.php index c175d83037..8223bfb431 100644 --- a/test/selenium/PmaSeleniumTableOperationsTest.php +++ b/test/selenium/TableOperationsTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumTableOperationsTest class + * TableOperationsTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumTableOperationsTest extends PmaSeleniumTestBase +class TableOperationsTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumTableStructureTest.php b/test/selenium/TableStructureTest.php similarity index 97% rename from test/selenium/PmaSeleniumTableStructureTest.php rename to test/selenium/TableStructureTest.php index 1c937375fa..788a931929 100644 --- a/test/selenium/PmaSeleniumTableStructureTest.php +++ b/test/selenium/TableStructureTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumTableStructureTest class + * TableStructureTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumTableStructureTest extends PmaSeleniumTestBase +class TableStructureTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumTestBase.php b/test/selenium/TestBase.php similarity index 99% rename from test/selenium/PmaSeleniumTestBase.php rename to test/selenium/TestBase.php index 9afbc89552..ac4e7c91d9 100644 --- a/test/selenium/PmaSeleniumTestBase.php +++ b/test/selenium/TestBase.php @@ -15,7 +15,7 @@ namespace PhpMyAdmin\Tests\Selenium; * @subpackage Selenium * @group selenium */ -abstract class PmaSeleniumTestBase extends \PHPUnit_Extensions_Selenium2TestCase +abstract class TestBase extends \PHPUnit_Extensions_Selenium2TestCase { /** * mysqli object diff --git a/test/selenium/PmaSeleniumTrackingTest.php b/test/selenium/TrackingTest.php similarity index 98% rename from test/selenium/PmaSeleniumTrackingTest.php rename to test/selenium/TrackingTest.php index 323a8fa734..70dbcff916 100644 --- a/test/selenium/PmaSeleniumTrackingTest.php +++ b/test/selenium/TrackingTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumTrackingTest class + * TrackingTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumTrackingTest extends PmaSeleniumTestBase +class TrackingTest extends TestBase { /** * Setup the browser environment to run the selenium test case diff --git a/test/selenium/PmaSeleniumXssTest.php b/test/selenium/XssTest.php similarity index 92% rename from test/selenium/PmaSeleniumXssTest.php rename to test/selenium/XssTest.php index 4736dc120e..3641047595 100644 --- a/test/selenium/PmaSeleniumXssTest.php +++ b/test/selenium/XssTest.php @@ -10,13 +10,13 @@ namespace PhpMyAdmin\Tests\Selenium; /** - * PmaSeleniumXSSTest class + * XSSTest class * * @package PhpMyAdmin-test * @subpackage Selenium * @group selenium */ -class PmaSeleniumXSSTest extends PmaSeleniumTestBase +class XSSTest extends TestBase { public function setUpPage() {