From c48f579832422bb7aa0eaac6fe8092b34dc607f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Mon, 18 Sep 2017 23:17:49 -0300 Subject: [PATCH 01/11] Add namespace to controllers tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- .../DatabaseStructureControllerTest.php | 13 +++++-------- .../Server}/ServerBinlogControllerTest.php | 6 +++--- .../ServerCollationsControllerTest.php | 8 +++----- .../Server}/ServerDatabasesControllerTest.php | 9 +++++---- .../Server}/ServerEnginesControllerTest.php | 12 ++++++------ .../Server}/ServerPluginsControllerTest.php | 11 ++++------- .../Server}/ServerVariablesControllerTest.php | 11 ++++++----- .../Table}/TableIndexesControllerTest.php | 19 +++++++++---------- .../Table}/TableRelationControllerTest.php | 8 ++------ .../Table}/TableSearchControllerTest.php | 10 ++++------ .../Table}/TableStructureControllerTest.php | 9 +++------ 11 files changed, 50 insertions(+), 66 deletions(-) rename test/classes/{controllers => Controllers/Database}/DatabaseStructureControllerTest.php (98%) rename test/classes/{controllers => Controllers/Server}/ServerBinlogControllerTest.php (98%) rename test/classes/{controllers => Controllers/Server}/ServerCollationsControllerTest.php (96%) rename test/classes/{controllers => Controllers/Server}/ServerDatabasesControllerTest.php (98%) rename test/classes/{controllers => Controllers/Server}/ServerEnginesControllerTest.php (94%) rename test/classes/{controllers => Controllers/Server}/ServerPluginsControllerTest.php (96%) rename test/classes/{controllers => Controllers/Server}/ServerVariablesControllerTest.php (97%) rename test/classes/{controllers => Controllers/Table}/TableIndexesControllerTest.php (94%) rename test/classes/{controllers => Controllers/Table}/TableRelationControllerTest.php (98%) rename test/classes/{controllers => Controllers/Table}/TableSearchControllerTest.php (98%) rename test/classes/{controllers => Controllers/Table}/TableStructureControllerTest.php (98%) diff --git a/test/classes/controllers/DatabaseStructureControllerTest.php b/test/classes/Controllers/Database/DatabaseStructureControllerTest.php similarity index 98% rename from test/classes/controllers/DatabaseStructureControllerTest.php rename to test/classes/Controllers/Database/DatabaseStructureControllerTest.php index d68aff0a01..901174acd6 100644 --- a/test/classes/controllers/DatabaseStructureControllerTest.php +++ b/test/classes/Controllers/Database/DatabaseStructureControllerTest.php @@ -1,32 +1,29 @@ false ); -//$_SESSION - - require_once 'libraries/server_common.inc.php'; -require_once 'test/PMATestCase.php'; /** * Tests for ServerCollationsController class * * @package PhpMyAdmin-test */ -class ServerCollationsControllerTest extends PMATestCase +class ServerCollationsControllerTest extends \PMATestCase { /** * Prepares environment for the test. diff --git a/test/classes/controllers/ServerDatabasesControllerTest.php b/test/classes/Controllers/Server/ServerDatabasesControllerTest.php similarity index 98% rename from test/classes/controllers/ServerDatabasesControllerTest.php rename to test/classes/Controllers/Server/ServerDatabasesControllerTest.php index 24351ef369..3f502c181e 100644 --- a/test/classes/controllers/ServerDatabasesControllerTest.php +++ b/test/classes/Controllers/Server/ServerDatabasesControllerTest.php @@ -5,13 +5,14 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Server; use PhpMyAdmin\Charsets; +use PhpMyAdmin\Config; use PhpMyAdmin\Di\Container; use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; - -require_once 'test/PMATestCase.php'; +use ReflectionClass; /** * Tests for ServerDatabasesController class @@ -19,7 +20,7 @@ require_once 'test/PMATestCase.php'; * @package PhpMyAdmin-test */ -class ServerDatabasesControllerTest extends PMATestCase +class ServerDatabasesControllerTest extends \PMATestCase { /** * Prepares environment for the test. @@ -33,7 +34,7 @@ class ServerDatabasesControllerTest extends PMATestCase $_REQUEST['pos'] = 3; //$GLOBALS - $GLOBALS['PMA_Config'] = new PhpMyAdmin\Config(); + $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['is_superuser'] = true; diff --git a/test/classes/controllers/ServerEnginesControllerTest.php b/test/classes/Controllers/Server/ServerEnginesControllerTest.php similarity index 94% rename from test/classes/controllers/ServerEnginesControllerTest.php rename to test/classes/Controllers/Server/ServerEnginesControllerTest.php index 14cd674b61..9cfaac48f0 100644 --- a/test/classes/controllers/ServerEnginesControllerTest.php +++ b/test/classes/Controllers/Server/ServerEnginesControllerTest.php @@ -5,21 +5,21 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Server; +use PhpMyAdmin\Controllers\Server\ServerEnginesController; use PhpMyAdmin\StorageEngine; use PhpMyAdmin\Theme; -use PhpMyAdmin\Controllers\Server\ServerEnginesController; use PhpMyAdmin\Url; - - -require_once 'test/PMATestCase.php'; +use PhpMyAdmin\Util; +use ReflectionClass; /** * Tests for ServerEnginesController class * * @package PhpMyAdmin-test */ -class ServerEnginesControllerTest extends PMATestCase +class ServerEnginesControllerTest extends \PMATestCase { /** * Prepares environment for the test. @@ -123,7 +123,7 @@ class ServerEnginesControllerTest extends PMATestCase //validate 2: Engine Mysql Help Page $this->assertContains( - PhpMyAdmin\Util::showMySQLDocu($engine_plugin->getMysqlHelpPage()), + Util::showMySQLDocu($engine_plugin->getMysqlHelpPage()), $html ); diff --git a/test/classes/controllers/ServerPluginsControllerTest.php b/test/classes/Controllers/Server/ServerPluginsControllerTest.php similarity index 96% rename from test/classes/controllers/ServerPluginsControllerTest.php rename to test/classes/Controllers/Server/ServerPluginsControllerTest.php index c4b0c29928..80d0dbfb86 100644 --- a/test/classes/controllers/ServerPluginsControllerTest.php +++ b/test/classes/Controllers/Server/ServerPluginsControllerTest.php @@ -5,22 +5,19 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Server; -/* - * Include to test. - */ -use PhpMyAdmin\Theme; use PhpMyAdmin\Controllers\Server\ServerPluginsController; use PhpMyAdmin\Di\Container; - -require_once 'test/PMATestCase.php'; +use PhpMyAdmin\Theme; +use ReflectionClass; /** * Tests for ServerPluginsController class * * @package PhpMyAdmin-test */ -class ServerPluginsControllerTest extends PMATestCase +class ServerPluginsControllerTest extends \PMATestCase { /** * Prepares environment for the test. diff --git a/test/classes/controllers/ServerVariablesControllerTest.php b/test/classes/Controllers/Server/ServerVariablesControllerTest.php similarity index 97% rename from test/classes/controllers/ServerVariablesControllerTest.php rename to test/classes/Controllers/Server/ServerVariablesControllerTest.php index 25f416c56e..717c41b267 100644 --- a/test/classes/controllers/ServerVariablesControllerTest.php +++ b/test/classes/Controllers/Server/ServerVariablesControllerTest.php @@ -5,21 +5,22 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Server; use PhpMyAdmin\Core; use PhpMyAdmin\Di\Container; use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; use PhpMyAdmin\Url; - -require_once 'test/PMATestCase.php'; +use PhpMyAdmin\Util; +use ReflectionClass; /** * Tests for ServerVariablesController class * * @package PhpMyAdmin-test */ -class ServerVariablesControllerTest extends PMATestCase +class ServerVariablesControllerTest extends \PMATestCase { /** * @var \PhpMyAdmin\Tests\Stubs\Response @@ -184,11 +185,11 @@ class ServerVariablesControllerTest extends PMATestCase ); //validate 2: images $this->assertContains( - PhpMyAdmin\Util::getIcon('b_save.png', __('Save')), + Util::getIcon('b_save.png', __('Save')), $html ); $this->assertContains( - PhpMyAdmin\Util::getIcon('b_close.png', __('Cancel')), + Util::getIcon('b_close.png', __('Cancel')), $html ); } diff --git a/test/classes/controllers/TableIndexesControllerTest.php b/test/classes/Controllers/Table/TableIndexesControllerTest.php similarity index 94% rename from test/classes/controllers/TableIndexesControllerTest.php rename to test/classes/Controllers/Table/TableIndexesControllerTest.php index 90a9aae9d4..2a92e6c3fe 100644 --- a/test/classes/controllers/TableIndexesControllerTest.php +++ b/test/classes/Controllers/Table/TableIndexesControllerTest.php @@ -5,25 +5,24 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Table; use PhpMyAdmin\Controllers\Table\TableIndexesController; use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Index; +use PhpMyAdmin\Message; use PhpMyAdmin\Response; use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; use PhpMyAdmin\Url; - -/* - * Include to test. - */ -require_once 'test/PMATestCase.php'; +use PhpMyAdmin\Util; /** * Tests for libraries/controllers/TableIndexesController.php * * @package PhpMyAdmin-test */ -class TableIndexesControllerTest extends PMATestCase +class TableIndexesControllerTest extends \PMATestCase { /** * Setup function for test cases @@ -152,7 +151,7 @@ class TableIndexesControllerTest extends PMATestCase $response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $response); $container->alias('response', 'PhpMyAdmin\Response'); - $index = new PhpMyAdmin\Index(); + $index = new Index(); $ctrl = new TableIndexesController($index); @@ -173,8 +172,8 @@ class TableIndexesControllerTest extends PMATestCase $html ); - $doc_html = PhpMyAdmin\Util::showHint( - PhpMyAdmin\Message::notice( + $doc_html = Util::showHint( + Message::notice( __( '"PRIMARY" must be the name of' . ' and only of a primary key!' @@ -187,7 +186,7 @@ class TableIndexesControllerTest extends PMATestCase ); $this->assertContains( - PhpMyAdmin\Util::showMySQLDocu('ALTER_TABLE'), + Util::showMySQLDocu('ALTER_TABLE'), $html ); diff --git a/test/classes/controllers/TableRelationControllerTest.php b/test/classes/Controllers/Table/TableRelationControllerTest.php similarity index 98% rename from test/classes/controllers/TableRelationControllerTest.php rename to test/classes/Controllers/Table/TableRelationControllerTest.php index 0720c11417..e6e3eed847 100644 --- a/test/classes/controllers/TableRelationControllerTest.php +++ b/test/classes/Controllers/Table/TableRelationControllerTest.php @@ -5,22 +5,18 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Table; -/* - * Include to test. - */ use PhpMyAdmin\Di\Container; use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for libraries/controllers/TableRelationController.php * * @package PhpMyAdmin-test */ -class TableRelationControllerTest extends PMATestCase +class TableRelationControllerTest extends \PMATestCase { /** * @var \PhpMyAdmin\Tests\Stubs\Response diff --git a/test/classes/controllers/TableSearchControllerTest.php b/test/classes/Controllers/Table/TableSearchControllerTest.php similarity index 98% rename from test/classes/controllers/TableSearchControllerTest.php rename to test/classes/Controllers/Table/TableSearchControllerTest.php index 09c08caa75..13f7a8f1ec 100644 --- a/test/classes/controllers/TableSearchControllerTest.php +++ b/test/classes/Controllers/Table/TableSearchControllerTest.php @@ -5,25 +5,23 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Table; -/* - * Include to test. - */ use PhpMyAdmin\Controllers\Table\TableSearchController; use PhpMyAdmin\Di\Container; use PhpMyAdmin\Relation; use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; use PhpMyAdmin\TypesMySQL; - -require_once 'test/PMATestCase.php'; +use ReflectionClass; +use stdClass; /** * Tests for PMA_TableSearch * * @package PhpMyAdmin-test */ -class TableSearchControllerTest extends PMATestCase +class TableSearchControllerTest extends \PMATestCase { /** * @var PhpMyAdmin\Tests\Stubs\Response diff --git a/test/classes/controllers/TableStructureControllerTest.php b/test/classes/Controllers/Table/TableStructureControllerTest.php similarity index 98% rename from test/classes/controllers/TableStructureControllerTest.php rename to test/classes/Controllers/Table/TableStructureControllerTest.php index 6e9ed8170d..249ed184ba 100644 --- a/test/classes/controllers/TableStructureControllerTest.php +++ b/test/classes/Controllers/Table/TableStructureControllerTest.php @@ -7,15 +7,12 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Controllers\Table; -/* - * Include to test. - */ use PhpMyAdmin\Di\Container; use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; - -require_once 'test/PMATestCase.php'; +use ReflectionClass; /** * TableStructureController_Test class @@ -24,7 +21,7 @@ require_once 'test/PMATestCase.php'; * * @package PhpMyAdmin-test */ -class TableStructureControllerTest extends PMATestCase +class TableStructureControllerTest extends \PMATestCase { /** * @var \PhpMyAdmin\Tests\Stubs\Response From 2241016ad35cf894bf43a655a45225bf7f1e3471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 19 Sep 2017 10:16:29 -0300 Subject: [PATCH 02/11] Add namespace to DBI tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/{dbi => Dbi}/DbiMysqlTest.php | 10 ++-------- test/classes/{dbi => Dbi}/DbiMysqliTest.php | 8 ++------ 2 files changed, 4 insertions(+), 14 deletions(-) rename test/classes/{dbi => Dbi}/DbiMysqlTest.php (98%) rename test/classes/{dbi => Dbi}/DbiMysqliTest.php (98%) diff --git a/test/classes/dbi/DbiMysqlTest.php b/test/classes/Dbi/DbiMysqlTest.php similarity index 98% rename from test/classes/dbi/DbiMysqlTest.php rename to test/classes/Dbi/DbiMysqlTest.php index 53f6a9b529..63c68a013c 100644 --- a/test/classes/dbi/DbiMysqlTest.php +++ b/test/classes/Dbi/DbiMysqlTest.php @@ -4,22 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Dbi; use PhpMyAdmin\Dbi\DbiMysql; -require_once 'test/PMATestCase.php'; - - /** * Tests for PhpMyAdmin\Dbi\DbiMysql class * * @package PhpMyAdmin-test */ -class DbiMysqlTest extends PMATestCase +class DbiMysqlTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/dbi/DbiMysqliTest.php b/test/classes/Dbi/DbiMysqliTest.php similarity index 98% rename from test/classes/dbi/DbiMysqliTest.php rename to test/classes/Dbi/DbiMysqliTest.php index 2045ba808b..115217b79a 100644 --- a/test/classes/dbi/DbiMysqliTest.php +++ b/test/classes/Dbi/DbiMysqliTest.php @@ -4,21 +4,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Dbi; -/* - * Include to test. - */ use PhpMyAdmin\Dbi\DbiMysqli; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Dbi\DbiMysqli class * * @package PhpMyAdmin-test */ -class DbiMysqliTest extends PMATestCase +class DbiMysqliTest extends \PMATestCase { /** * @access protected From 3c1427ba6961d00ff797f414db126d3ab89ff1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 19 Sep 2017 10:57:51 -0300 Subject: [PATCH 03/11] Add namespace to DIC tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/{di => Di}/ContainerExceptionTest.php | 8 ++------ test/classes/{di => Di}/ContainerTest.php | 8 ++------ test/classes/{di => Di}/NotFoundExceptionTest.php | 8 ++------ 3 files changed, 6 insertions(+), 18 deletions(-) rename test/classes/{di => Di}/ContainerExceptionTest.php (92%) rename test/classes/{di => Di}/ContainerTest.php (94%) rename test/classes/{di => Di}/NotFoundExceptionTest.php (93%) diff --git a/test/classes/di/ContainerExceptionTest.php b/test/classes/Di/ContainerExceptionTest.php similarity index 92% rename from test/classes/di/ContainerExceptionTest.php rename to test/classes/Di/ContainerExceptionTest.php index cd8606fd62..252cdc9251 100644 --- a/test/classes/di/ContainerExceptionTest.php +++ b/test/classes/Di/ContainerExceptionTest.php @@ -5,11 +5,7 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ -require_once 'test/PMATestCase.php'; +namespace PhpMyAdmin\Tests\Di; use PhpMyAdmin\Di\ContainerException; @@ -18,7 +14,7 @@ use PhpMyAdmin\Di\ContainerException; * * @package PhpMyAdmin-test */ -class ContainerExceptionTest extends PMATestCase +class ContainerExceptionTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/di/ContainerTest.php b/test/classes/Di/ContainerTest.php similarity index 94% rename from test/classes/di/ContainerTest.php rename to test/classes/Di/ContainerTest.php index 043013eb09..c07279d9e8 100644 --- a/test/classes/di/ContainerTest.php +++ b/test/classes/Di/ContainerTest.php @@ -5,11 +5,7 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ -require_once 'test/PMATestCase.php'; +namespace PhpMyAdmin\Tests\Di; use PhpMyAdmin\Di\Container; @@ -18,7 +14,7 @@ use PhpMyAdmin\Di\Container; * * @package PhpMyAdmin-test */ -class ContainerTest extends PMATestCase +class ContainerTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/di/NotFoundExceptionTest.php b/test/classes/Di/NotFoundExceptionTest.php similarity index 93% rename from test/classes/di/NotFoundExceptionTest.php rename to test/classes/Di/NotFoundExceptionTest.php index c317a611c5..29054f2fb1 100644 --- a/test/classes/di/NotFoundExceptionTest.php +++ b/test/classes/Di/NotFoundExceptionTest.php @@ -5,11 +5,7 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ -require_once 'test/PMATestCase.php'; +namespace PhpMyAdmin\Tests\Di; use PhpMyAdmin\Di\NotFoundException; @@ -18,7 +14,7 @@ use PhpMyAdmin\Di\NotFoundException; * * @package PhpMyAdmin-test */ -class NotFoundExceptionTest extends PMATestCase +class NotFoundExceptionTest extends \PMATestCase { /** * @access protected From 14ffa1f2328aa3d26bf750292b106aeab1ab171c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 19 Sep 2017 10:58:44 -0300 Subject: [PATCH 04/11] Add test/PMATestCase.php to autoload-dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c8db71e803..6572b3c6ae 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "autoload-dev": { "psr-4": { "PhpMyAdmin\\Tests\\": "test/classes" - } + }, + "classmap": ["test/PMATestCase.php"] }, "repositories": [ { From 3419e31e9624ba867aa1478b3cbd80c7687fbe6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 19 Sep 2017 15:05:03 -0300 Subject: [PATCH 05/11] Add namespace to engines tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/{engines => Engines}/BdbTest.php | 9 ++------- test/classes/{engines => Engines}/BinlogTest.php | 9 ++------- test/classes/{engines => Engines}/InnodbTest.php | 9 ++------- test/classes/{engines => Engines}/MemoryTest.php | 9 ++------- test/classes/{engines => Engines}/MrgMyisamTest.php | 9 ++------- test/classes/{engines => Engines}/MyisamTest.php | 9 ++------- test/classes/{engines => Engines}/NdbclusterTest.php | 9 ++------- test/classes/{engines => Engines}/PbxtTest.php | 9 ++------- 8 files changed, 16 insertions(+), 56 deletions(-) rename test/classes/{engines => Engines}/BdbTest.php (96%) rename test/classes/{engines => Engines}/BinlogTest.php (91%) rename test/classes/{engines => Engines}/InnodbTest.php (98%) rename test/classes/{engines => Engines}/MemoryTest.php (92%) rename test/classes/{engines => Engines}/MrgMyisamTest.php (91%) rename test/classes/{engines => Engines}/MyisamTest.php (97%) rename test/classes/{engines => Engines}/NdbclusterTest.php (94%) rename test/classes/{engines => Engines}/PbxtTest.php (98%) diff --git a/test/classes/engines/BdbTest.php b/test/classes/Engines/BdbTest.php similarity index 96% rename from test/classes/engines/BdbTest.php rename to test/classes/Engines/BdbTest.php index e6493ed0ae..b01d8856f8 100644 --- a/test/classes/engines/BdbTest.php +++ b/test/classes/Engines/BdbTest.php @@ -4,21 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Bdb; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\Bdb * * @package PhpMyAdmin-test */ -class BdbTest extends PMATestCase +class BdbTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/engines/BinlogTest.php b/test/classes/Engines/BinlogTest.php similarity index 91% rename from test/classes/engines/BinlogTest.php rename to test/classes/Engines/BinlogTest.php index aef7ad3272..4697095ac5 100644 --- a/test/classes/engines/BinlogTest.php +++ b/test/classes/Engines/BinlogTest.php @@ -4,21 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Binlog; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\Binlog * * @package PhpMyAdmin-test */ -class BinlogTest extends PMATestCase +class BinlogTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/engines/InnodbTest.php b/test/classes/Engines/InnodbTest.php similarity index 98% rename from test/classes/engines/InnodbTest.php rename to test/classes/Engines/InnodbTest.php index b25fa26ffa..efb19c2f8c 100644 --- a/test/classes/engines/InnodbTest.php +++ b/test/classes/Engines/InnodbTest.php @@ -4,21 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Innodb; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\Innodb * * @package PhpMyAdmin-test */ -class InnodbTest extends PMATestCase +class InnodbTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/engines/MemoryTest.php b/test/classes/Engines/MemoryTest.php similarity index 92% rename from test/classes/engines/MemoryTest.php rename to test/classes/Engines/MemoryTest.php index 89050b9c16..65a68e3970 100644 --- a/test/classes/engines/MemoryTest.php +++ b/test/classes/Engines/MemoryTest.php @@ -4,21 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Memory; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\Memory * * @package PhpMyAdmin-test */ -class MemoryTest extends PMATestCase +class MemoryTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/engines/MrgMyisamTest.php b/test/classes/Engines/MrgMyisamTest.php similarity index 91% rename from test/classes/engines/MrgMyisamTest.php rename to test/classes/Engines/MrgMyisamTest.php index 63f6826986..2cad7855f0 100644 --- a/test/classes/engines/MrgMyisamTest.php +++ b/test/classes/Engines/MrgMyisamTest.php @@ -4,21 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\MrgMyisam; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\MrgMyisam * * @package PhpMyAdmin-test */ -class MrgMyisamTest extends PMATestCase +class MrgMyisamTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/engines/MyisamTest.php b/test/classes/Engines/MyisamTest.php similarity index 97% rename from test/classes/engines/MyisamTest.php rename to test/classes/Engines/MyisamTest.php index 3aadb3e95d..c1eda49f55 100644 --- a/test/classes/engines/MyisamTest.php +++ b/test/classes/Engines/MyisamTest.php @@ -4,21 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Myisam; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\Myisam * * @package PhpMyAdmin-test */ -class MyisamTest extends PMATestCase +class MyisamTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/engines/NdbclusterTest.php b/test/classes/Engines/NdbclusterTest.php similarity index 94% rename from test/classes/engines/NdbclusterTest.php rename to test/classes/Engines/NdbclusterTest.php index bdd9af4e3a..cf44dab264 100644 --- a/test/classes/engines/NdbclusterTest.php +++ b/test/classes/Engines/NdbclusterTest.php @@ -4,21 +4,16 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Ndbcluster; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\Ndbcluster * * @package PhpMyAdmin-test */ -class NdbclusterTest extends PMATestCase +class NdbclusterTest extends \PMATestCase { /** * @access protected diff --git a/test/classes/engines/PbxtTest.php b/test/classes/Engines/PbxtTest.php similarity index 98% rename from test/classes/engines/PbxtTest.php rename to test/classes/Engines/PbxtTest.php index 0c3314f29c..44fdc409d2 100644 --- a/test/classes/engines/PbxtTest.php +++ b/test/classes/Engines/PbxtTest.php @@ -5,22 +5,17 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ +namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Core; use PhpMyAdmin\Engines\Pbxt; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Engines\Pbxt; * * @package PhpMyAdmin-test */ -class PbxtTest extends PMATestCase +class PbxtTest extends \PMATestCase { /** * @access protected From 1ed3e0fbae0adf03947f41ba0a413324ef356ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 19 Sep 2017 15:19:10 -0300 Subject: [PATCH 06/11] Add namespace to GIS tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/{gis => Gis}/GisFactoryTest.php | 5 ++++- test/classes/{gis => Gis}/GisGeomTest.php | 5 ++++- test/classes/{gis => Gis}/GisGeometryCollectionTest.php | 9 ++++++--- test/classes/{gis => Gis}/GisGeometryTest.php | 6 +++++- test/classes/{gis => Gis}/GisLineStringTest.php | 5 +++-- test/classes/{gis => Gis}/GisMultiLineStringTest.php | 5 +++-- test/classes/{gis => Gis}/GisMultiPointTest.php | 5 +++-- test/classes/{gis => Gis}/GisMultiPolygonTest.php | 5 +++-- test/classes/{gis => Gis}/GisPointTest.php | 5 +++-- test/classes/{gis => Gis}/GisPolygonTest.php | 5 +++-- 10 files changed, 37 insertions(+), 18 deletions(-) rename test/classes/{gis => Gis}/GisFactoryTest.php (93%) rename test/classes/{gis => Gis}/GisGeomTest.php (92%) rename test/classes/{gis => Gis}/GisGeometryCollectionTest.php (98%) rename test/classes/{gis => Gis}/GisGeometryTest.php (98%) rename test/classes/{gis => Gis}/GisLineStringTest.php (99%) rename test/classes/{gis => Gis}/GisMultiLineStringTest.php (99%) rename test/classes/{gis => Gis}/GisMultiPointTest.php (99%) rename test/classes/{gis => Gis}/GisMultiPolygonTest.php (99%) rename test/classes/{gis => Gis}/GisPointTest.php (99%) rename test/classes/{gis => Gis}/GisPolygonTest.php (99%) diff --git a/test/classes/gis/GisFactoryTest.php b/test/classes/Gis/GisFactoryTest.php similarity index 93% rename from test/classes/gis/GisFactoryTest.php rename to test/classes/Gis/GisFactoryTest.php index 685fd30ba6..041cade84e 100644 --- a/test/classes/gis/GisFactoryTest.php +++ b/test/classes/Gis/GisFactoryTest.php @@ -5,14 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; + use PhpMyAdmin\Gis\GisFactory; +use PHPUnit_Framework_TestCase as TestCase; /** * Test class for PhpMyAdmin\Gis\GisFactory * * @package PhpMyAdmin-test */ -class GisFactoryTest extends PHPUnit_Framework_TestCase +class GisFactoryTest extends TestCase { /** diff --git a/test/classes/gis/GisGeomTest.php b/test/classes/Gis/GisGeomTest.php similarity index 92% rename from test/classes/gis/GisGeomTest.php rename to test/classes/Gis/GisGeomTest.php index a2ef32c8c1..a9a8b80225 100644 --- a/test/classes/gis/GisGeomTest.php +++ b/test/classes/Gis/GisGeomTest.php @@ -5,13 +5,16 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; + +use PHPUnit_Framework_TestCase as TestCase; /** * Abstract parent class for all GIS test classes * * @package PhpMyAdmin-test */ -abstract class GisGeomTest extends PHPUnit_Framework_TestCase +abstract class GisGeomTest extends TestCase { /** diff --git a/test/classes/gis/GisGeometryCollectionTest.php b/test/classes/Gis/GisGeometryCollectionTest.php similarity index 98% rename from test/classes/gis/GisGeometryCollectionTest.php rename to test/classes/Gis/GisGeometryCollectionTest.php index 8116752a0f..4bfb09044b 100644 --- a/test/classes/gis/GisGeometryCollectionTest.php +++ b/test/classes/Gis/GisGeometryCollectionTest.php @@ -6,15 +6,18 @@ * * @package PhpMyAdmin-test */ -use PhpMyAdmin\Gis\GisGeometryCollection; +namespace PhpMyAdmin\Tests\Gis; +use PhpMyAdmin\Gis\GisGeometryCollection; +use PHPUnit_Framework_TestCase as TestCase; +use TCPDF; /** * Tests for PhpMyAdmin\Gis\GisGeometryCollection class * * @package PhpMyAdmin-test */ -class GisGeometryCollectionTest extends PHPUnit_Framework_TestCase +class GisGeometryCollectionTest extends TestCase { /** @@ -268,7 +271,7 @@ class GisGeometryCollectionTest extends PHPUnit_Framework_TestCase 'scale' => 2, 'height' => 150 ), - new \TCPDF(), + new TCPDF(), ) ); } diff --git a/test/classes/gis/GisGeometryTest.php b/test/classes/Gis/GisGeometryTest.php similarity index 98% rename from test/classes/gis/GisGeometryTest.php rename to test/classes/Gis/GisGeometryTest.php index f343500419..51c74c0e40 100644 --- a/test/classes/gis/GisGeometryTest.php +++ b/test/classes/Gis/GisGeometryTest.php @@ -5,13 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; + +use PHPUnit_Framework_TestCase as TestCase; +use ReflectionClass; /** * Tests for PhpMyAdmin\Gis\GisGeometry class * * @package PhpMyAdmin-test */ -class GisGeometryTest extends PHPUnit_Framework_TestCase +class GisGeometryTest extends TestCase { /** * @access protected diff --git a/test/classes/gis/GisLineStringTest.php b/test/classes/Gis/GisLineStringTest.php similarity index 99% rename from test/classes/gis/GisLineStringTest.php rename to test/classes/Gis/GisLineStringTest.php index 79544da360..59cfdc0db7 100644 --- a/test/classes/gis/GisLineStringTest.php +++ b/test/classes/Gis/GisLineStringTest.php @@ -5,10 +5,11 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisLineString; - -require_once 'GisGeomTest.php'; +use PhpMyAdmin\Tests\Gis\GisGeomTest; +use TCPDF; /** * Tests for PhpMyAdmin\Gis\GisLineString class diff --git a/test/classes/gis/GisMultiLineStringTest.php b/test/classes/Gis/GisMultiLineStringTest.php similarity index 99% rename from test/classes/gis/GisMultiLineStringTest.php rename to test/classes/Gis/GisMultiLineStringTest.php index 16caefb5e5..b37594bf1d 100644 --- a/test/classes/gis/GisMultiLineStringTest.php +++ b/test/classes/Gis/GisMultiLineStringTest.php @@ -5,10 +5,11 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisMultiLineString; - -require_once 'GisGeomTest.php'; +use PhpMyAdmin\Tests\Gis\GisGeomTest; +use TCPDF; /** * Tests for PhpMyAdmin\Gis\GisMultiLineString class diff --git a/test/classes/gis/GisMultiPointTest.php b/test/classes/Gis/GisMultiPointTest.php similarity index 99% rename from test/classes/gis/GisMultiPointTest.php rename to test/classes/Gis/GisMultiPointTest.php index 254e4b60fd..3ac100e2a4 100644 --- a/test/classes/gis/GisMultiPointTest.php +++ b/test/classes/Gis/GisMultiPointTest.php @@ -5,10 +5,11 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisMultiPoint; - -require_once 'GisGeomTest.php'; +use PhpMyAdmin\Tests\Gis\GisGeomTest; +use TCPDF; /** * Tests for PhpMyAdmin\Gis\GisMultiPoint class diff --git a/test/classes/gis/GisMultiPolygonTest.php b/test/classes/Gis/GisMultiPolygonTest.php similarity index 99% rename from test/classes/gis/GisMultiPolygonTest.php rename to test/classes/Gis/GisMultiPolygonTest.php index 0557f7a8c7..a346a55686 100644 --- a/test/classes/gis/GisMultiPolygonTest.php +++ b/test/classes/Gis/GisMultiPolygonTest.php @@ -5,10 +5,11 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisMultiPolygon; - -require_once 'GisGeomTest.php'; +use PhpMyAdmin\Tests\Gis\GisGeomTest; +use TCPDF; /** * Tests for PhpMyAdmin\Gis\GisMultiPolygon class diff --git a/test/classes/gis/GisPointTest.php b/test/classes/Gis/GisPointTest.php similarity index 99% rename from test/classes/gis/GisPointTest.php rename to test/classes/Gis/GisPointTest.php index b680a56990..cf321458ac 100644 --- a/test/classes/gis/GisPointTest.php +++ b/test/classes/Gis/GisPointTest.php @@ -5,10 +5,11 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisPoint; - -require_once 'GisGeomTest.php'; +use PhpMyAdmin\Tests\Gis\GisGeomTest; +use TCPDF; /** * Tests for PhpMyAdmin\Gis\GisPoint class. diff --git a/test/classes/gis/GisPolygonTest.php b/test/classes/Gis/GisPolygonTest.php similarity index 99% rename from test/classes/gis/GisPolygonTest.php rename to test/classes/Gis/GisPolygonTest.php index 2a6b7bfb79..6f55e514f4 100644 --- a/test/classes/gis/GisPolygonTest.php +++ b/test/classes/Gis/GisPolygonTest.php @@ -5,10 +5,11 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisPolygon; - -require_once 'GisGeomTest.php'; +use PhpMyAdmin\Tests\Gis\GisGeomTest; +use TCPDF; /** * Tests for PhpMyAdmin\Gis\GisPolygon class From 951116c04e673519fe95897768261e92d3b6f988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 19 Sep 2017 15:37:02 -0300 Subject: [PATCH 07/11] Add namespace to Navigation tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- .../{navigation => Navigation}/NavigationTest.php | 8 ++++---- .../NavigationTreeTest.php | 15 ++++++++------- .../NodeFactoryTest.php | 5 ++--- .../Nodes}/NodeColumnContainerTest.php | 5 ++--- .../Nodes}/NodeColumnTest.php | 5 ++--- .../Nodes}/NodeDatabaseChildTest.php | 5 ++--- .../Nodes}/NodeDatabaseTest.php | 5 ++--- .../Nodes}/NodeEventContainerTest.php | 5 ++--- .../Nodes}/NodeEventTest.php | 5 ++--- .../Nodes}/NodeFunctionContainerTest.php | 5 ++--- .../Nodes}/NodeFunctionTest.php | 5 ++--- .../Nodes}/NodeIndexContainerTest.php | 5 ++--- .../Nodes}/NodeIndexTest.php | 5 ++--- .../Nodes}/NodeProcedureContainerTest.php | 5 ++--- .../Nodes}/NodeProcedureTest.php | 5 ++--- .../Nodes}/NodeTableContainerTest.php | 5 ++--- .../Nodes}/NodeTableTest.php | 5 ++--- .../{navigation => Navigation/Nodes}/NodeTest.php | 6 +++--- .../Nodes}/NodeTriggerContainerTest.php | 5 ++--- .../Nodes}/NodeTriggerTest.php | 5 ++--- .../Nodes}/NodeViewContainerTest.php | 5 ++--- .../Nodes}/NodeViewTest.php | 6 ++---- 22 files changed, 53 insertions(+), 72 deletions(-) rename test/classes/{navigation => Navigation}/NavigationTest.php (96%) rename test/classes/{navigation => Navigation}/NavigationTreeTest.php (91%) rename test/classes/{navigation => Navigation}/NodeFactoryTest.php (96%) rename test/classes/{navigation => Navigation/Nodes}/NodeColumnContainerTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeColumnTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeDatabaseChildTest.php (95%) rename test/classes/{navigation => Navigation/Nodes}/NodeDatabaseTest.php (97%) rename test/classes/{navigation => Navigation/Nodes}/NodeEventContainerTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeEventTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeFunctionContainerTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeFunctionTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeIndexContainerTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeIndexTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeProcedureContainerTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeProcedureTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeTableContainerTest.php (92%) rename test/classes/{navigation => Navigation/Nodes}/NodeTableTest.php (96%) rename test/classes/{navigation => Navigation/Nodes}/NodeTest.php (99%) rename test/classes/{navigation => Navigation/Nodes}/NodeTriggerContainerTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeTriggerTest.php (90%) rename test/classes/{navigation => Navigation/Nodes}/NodeViewContainerTest.php (92%) rename test/classes/{navigation => Navigation/Nodes}/NodeViewTest.php (91%) diff --git a/test/classes/navigation/NavigationTest.php b/test/classes/Navigation/NavigationTest.php similarity index 96% rename from test/classes/navigation/NavigationTest.php rename to test/classes/Navigation/NavigationTest.php index f42e2ffe06..585c406427 100644 --- a/test/classes/navigation/NavigationTest.php +++ b/test/classes/Navigation/NavigationTest.php @@ -5,18 +5,18 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation; +use PhpMyAdmin\Navigation\Navigation; use PhpMyAdmin\Theme; use PhpMyAdmin\Url; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Navigation class * * @package PhpMyAdmin-test */ -class NavigationTest extends PMATestCase +class NavigationTest extends \PMATestCase { /** * @var PhpMyAdmin\Navigation\Navigation @@ -31,7 +31,7 @@ class NavigationTest extends PMATestCase */ protected function setUp() { - $this->object = new PhpMyAdmin\Navigation\Navigation(); + $this->object = new Navigation(); $GLOBALS['cfgRelation']['db'] = 'pmadb'; $GLOBALS['cfgRelation']['navigationhiding'] = 'navigationhiding'; $GLOBALS['cfg']['Server']['user'] = 'user'; diff --git a/test/classes/navigation/NavigationTreeTest.php b/test/classes/Navigation/NavigationTreeTest.php similarity index 91% rename from test/classes/navigation/NavigationTreeTest.php rename to test/classes/Navigation/NavigationTreeTest.php index ae98737740..39f88c1f2a 100644 --- a/test/classes/navigation/NavigationTreeTest.php +++ b/test/classes/Navigation/NavigationTreeTest.php @@ -5,26 +5,27 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation; + +use PhpMyAdmin\Config; +use PhpMyAdmin\Navigation\NavigationTree; +use PhpMyAdmin\Theme; /* * we must set $GLOBALS['server'] here * since 'check_user_privileges.inc.php' will use it globally */ -use PhpMyAdmin\Navigation\NavigationTree; -use PhpMyAdmin\Theme; - $GLOBALS['server'] = 0; $GLOBALS['cfg']['Server']['DisableIS'] = false; require_once 'libraries/check_user_privileges.inc.php'; -require_once 'test/PMATestCase.php'; /** * Tests for PhpMyAdmin\Navigation\NavigationTree class * * @package PhpMyAdmin-test */ -class NavigationTreeTest extends PMATestCase +class NavigationTreeTest extends \PMATestCase { /** * @var NavigationTree @@ -40,7 +41,7 @@ class NavigationTreeTest extends PMATestCase protected function setUp() { $GLOBALS['server'] = 1; - $GLOBALS['PMA_Config'] = new PhpMyAdmin\Config(); + $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['cfg']['Server']['host'] = 'localhost'; $GLOBALS['cfg']['Server']['user'] = 'root'; @@ -52,7 +53,7 @@ class NavigationTreeTest extends PMATestCase $GLOBALS['pmaThemeImage'] = 'image'; $GLOBALS['db'] = 'db'; - $this->object = new PhpMyAdmin\Navigation\NavigationTree(); + $this->object = new NavigationTree(); } /** diff --git a/test/classes/navigation/NodeFactoryTest.php b/test/classes/Navigation/NodeFactoryTest.php similarity index 96% rename from test/classes/navigation/NodeFactoryTest.php rename to test/classes/Navigation/NodeFactoryTest.php index 6034a35aa4..115c313a4e 100644 --- a/test/classes/navigation/NodeFactoryTest.php +++ b/test/classes/Navigation/NodeFactoryTest.php @@ -5,19 +5,18 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\Node; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for NodeFactory class * * @package PhpMyAdmin-test */ -class NodeFactoryTest extends PMATestCase +class NodeFactoryTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeColumnContainerTest.php b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php similarity index 90% rename from test/classes/navigation/NodeColumnContainerTest.php rename to test/classes/Navigation/Nodes/NodeColumnContainerTest.php index bccc8299e9..1403df2a67 100644 --- a/test/classes/navigation/NodeColumnContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeColumnContainer class * * @package PhpMyAdmin-test */ -class NodeColumnContainerTest extends PMATestCase +class NodeColumnContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeColumnTest.php b/test/classes/Navigation/Nodes/NodeColumnTest.php similarity index 90% rename from test/classes/navigation/NodeColumnTest.php rename to test/classes/Navigation/Nodes/NodeColumnTest.php index 53b3d13a0d..00e2850050 100644 --- a/test/classes/navigation/NodeColumnTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeColumn class * * @package PhpMyAdmin-test */ -class NodeColumnTest extends PMATestCase +class NodeColumnTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeDatabaseChildTest.php b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php similarity index 95% rename from test/classes/navigation/NodeDatabaseChildTest.php rename to test/classes/Navigation/Nodes/NodeDatabaseChildTest.php index 2a60a25a5d..1934a80dc0 100644 --- a/test/classes/navigation/NodeDatabaseChildTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php @@ -5,20 +5,19 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild; use PhpMyAdmin\Theme; use PhpMyAdmin\Url; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild class * * @package PhpMyAdmin-test */ -class NodeDatabaseChildTest extends PMATestCase +class NodeDatabaseChildTest extends \PMATestCase { /** * @var NodeDatabaseChild diff --git a/test/classes/navigation/NodeDatabaseTest.php b/test/classes/Navigation/Nodes/NodeDatabaseTest.php similarity index 97% rename from test/classes/navigation/NodeDatabaseTest.php rename to test/classes/Navigation/Nodes/NodeDatabaseTest.php index a6f285d8be..2ac18c5f03 100644 --- a/test/classes/navigation/NodeDatabaseTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeDatabase class * * @package PhpMyAdmin-test */ -class NodeDatabaseTest extends PMATestCase +class NodeDatabaseTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeEventContainerTest.php b/test/classes/Navigation/Nodes/NodeEventContainerTest.php similarity index 90% rename from test/classes/navigation/NodeEventContainerTest.php rename to test/classes/Navigation/Nodes/NodeEventContainerTest.php index 2f228e252a..14703f21dc 100644 --- a/test/classes/navigation/NodeEventContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeEventContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeEventContainer class * * @package PhpMyAdmin-test */ -class NodeEventContainerTest extends PMATestCase +class NodeEventContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeEventTest.php b/test/classes/Navigation/Nodes/NodeEventTest.php similarity index 90% rename from test/classes/navigation/NodeEventTest.php rename to test/classes/Navigation/Nodes/NodeEventTest.php index 41e90d33b2..640166895d 100644 --- a/test/classes/navigation/NodeEventTest.php +++ b/test/classes/Navigation/Nodes/NodeEventTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeEvent class * * @package PhpMyAdmin-test */ -class NodeEventTest extends PMATestCase +class NodeEventTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeFunctionContainerTest.php b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php similarity index 90% rename from test/classes/navigation/NodeFunctionContainerTest.php rename to test/classes/Navigation/Nodes/NodeFunctionContainerTest.php index 32c3cffb28..7557d75378 100644 --- a/test/classes/navigation/NodeFunctionContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeFunctionContainer class * * @package PhpMyAdmin-test */ -class NodeFunctionContainerTest extends PMATestCase +class NodeFunctionContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeFunctionTest.php b/test/classes/Navigation/Nodes/NodeFunctionTest.php similarity index 90% rename from test/classes/navigation/NodeFunctionTest.php rename to test/classes/Navigation/Nodes/NodeFunctionTest.php index 8450691196..6c1213ec99 100644 --- a/test/classes/navigation/NodeFunctionTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeFunction class * * @package PhpMyAdmin-test */ -class NodeFunctionTest extends PMATestCase +class NodeFunctionTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeIndexContainerTest.php b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php similarity index 90% rename from test/classes/navigation/NodeIndexContainerTest.php rename to test/classes/Navigation/Nodes/NodeIndexContainerTest.php index 56ddbd7feb..fefa9fbeee 100644 --- a/test/classes/navigation/NodeIndexContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeIndexContainer class * * @package PhpMyAdmin-test */ -class NodeIndexContainerTest extends PMATestCase +class NodeIndexContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeIndexTest.php b/test/classes/Navigation/Nodes/NodeIndexTest.php similarity index 90% rename from test/classes/navigation/NodeIndexTest.php rename to test/classes/Navigation/Nodes/NodeIndexTest.php index 4d76aa669d..31f130e0c4 100644 --- a/test/classes/navigation/NodeIndexTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeIndex class * * @package PhpMyAdmin-test */ -class NodeIndexTest extends PMATestCase +class NodeIndexTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeProcedureContainerTest.php b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php similarity index 90% rename from test/classes/navigation/NodeProcedureContainerTest.php rename to test/classes/Navigation/Nodes/NodeProcedureContainerTest.php index b1ed475e98..090ea29a97 100644 --- a/test/classes/navigation/NodeProcedureContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeProcedureContainer class * * @package PhpMyAdmin-test */ -class NodeProcedureContainerTest extends PMATestCase +class NodeProcedureContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeProcedureTest.php b/test/classes/Navigation/Nodes/NodeProcedureTest.php similarity index 90% rename from test/classes/navigation/NodeProcedureTest.php rename to test/classes/Navigation/Nodes/NodeProcedureTest.php index 2effaa418b..5a71634c02 100644 --- a/test/classes/navigation/NodeProcedureTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeProcedure class * * @package PhpMyAdmin-test */ -class NodeProcedureTest extends PMATestCase +class NodeProcedureTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeTableContainerTest.php b/test/classes/Navigation/Nodes/NodeTableContainerTest.php similarity index 92% rename from test/classes/navigation/NodeTableContainerTest.php rename to test/classes/Navigation/Nodes/NodeTableContainerTest.php index a562b67422..4be1b6cbce 100644 --- a/test/classes/navigation/NodeTableContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTableContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeTableContainer class * * @package PhpMyAdmin-test */ -class NodeTableContainerTest extends PMATestCase +class NodeTableContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeTableTest.php b/test/classes/Navigation/Nodes/NodeTableTest.php similarity index 96% rename from test/classes/navigation/NodeTableTest.php rename to test/classes/Navigation/Nodes/NodeTableTest.php index 36749370f7..c6f188c7ff 100644 --- a/test/classes/navigation/NodeTableTest.php +++ b/test/classes/Navigation/Nodes/NodeTableTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeTable class * * @package PhpMyAdmin-test */ -class NodeTableTest extends PMATestCase +class NodeTableTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php similarity index 99% rename from test/classes/navigation/NodeTest.php rename to test/classes/Navigation/Nodes/NodeTest.php index 26ef08da6f..c2794ae141 100644 --- a/test/classes/navigation/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -5,19 +5,19 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\Node; use PhpMyAdmin\Theme; - -require_once 'test/PMATestCase.php'; +use ReflectionMethod; /** * Tests for Node class * * @package PhpMyAdmin-test */ -class NodeTest extends PMATestCase +class NodeTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeTriggerContainerTest.php b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php similarity index 90% rename from test/classes/navigation/NodeTriggerContainerTest.php rename to test/classes/Navigation/Nodes/NodeTriggerContainerTest.php index 44d7b85552..29338f46c0 100644 --- a/test/classes/navigation/NodeTriggerContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeTrigger class * * @package PhpMyAdmin-test */ -class NodeTriggerContainerTest extends PMATestCase +class NodeTriggerContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeTriggerTest.php b/test/classes/Navigation/Nodes/NodeTriggerTest.php similarity index 90% rename from test/classes/navigation/NodeTriggerTest.php rename to test/classes/Navigation/Nodes/NodeTriggerTest.php index 605128ba1d..65c06979f5 100644 --- a/test/classes/navigation/NodeTriggerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeTrigger class * * @package PhpMyAdmin-test */ -class NodeTriggerTest extends PMATestCase +class NodeTriggerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeViewContainerTest.php b/test/classes/Navigation/Nodes/NodeViewContainerTest.php similarity index 92% rename from test/classes/navigation/NodeViewContainerTest.php rename to test/classes/Navigation/Nodes/NodeViewContainerTest.php index a7af9198a3..caf51d41fc 100644 --- a/test/classes/navigation/NodeViewContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeViewContainerTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeViewContainer class * * @package PhpMyAdmin-test */ -class NodeViewContainerTest extends PMATestCase +class NodeViewContainerTest extends \PMATestCase { /** * SetUp for test cases diff --git a/test/classes/navigation/NodeViewTest.php b/test/classes/Navigation/Nodes/NodeViewTest.php similarity index 91% rename from test/classes/navigation/NodeViewTest.php rename to test/classes/Navigation/Nodes/NodeViewTest.php index 9967bbc8d8..6a9f39b51b 100644 --- a/test/classes/navigation/NodeViewTest.php +++ b/test/classes/Navigation/Nodes/NodeViewTest.php @@ -5,18 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Theme; -require_once 'test/PMATestCase.php'; - /** * Tests for PhpMyAdmin\Navigation\Nodes\NodeView class * * @package PhpMyAdmin-test */ -class NodeViewTest extends PMATestCase +class NodeViewTest extends \PMATestCase { /** * SetUp for test cases @@ -28,7 +27,6 @@ class NodeViewTest extends PMATestCase $GLOBALS['server'] = 0; } - /** * Test for __construct * From df30240015fe0ce229eb29e9bed8dc944bd501d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 19 Sep 2017 20:52:46 -0300 Subject: [PATCH 08/11] Add namespace to test classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/AdvisorTest.php | 8 +--- test/classes/BookmarkTest.php | 6 ++- test/classes/BrowseForeignersTest.php | 3 +- test/classes/CentralColumnsTest.php | 4 +- test/classes/CharsetsTest.php | 4 +- test/classes/CheckUserPrivilegesTest.php | 3 +- test/classes/ConfigTest.php | 41 +++++++++---------- test/classes/CoreTest.php | 9 ++-- test/classes/Database/DesignerTest.php | 3 +- test/classes/DatabaseInterfaceTest.php | 13 +++--- test/classes/DbQbeTest.php | 10 ++--- test/classes/DbSearchTest.php | 10 ++--- test/classes/Display/ChangePasswordTest.php | 3 +- test/classes/Display/CreateTableTest.php | 3 +- test/classes/Display/ExportTest.php | 3 +- test/classes/Display/ResultsTest.php | 5 --- test/classes/EncodingTest.php | 4 +- test/classes/ErrorHandlerTest.php | 11 ++--- test/classes/ErrorTest.php | 13 ++---- test/classes/ExportTest.php | 3 +- test/classes/FileTest.php | 19 +++++---- test/classes/FontTest.php | 5 +-- test/classes/FooterTest.php | 10 ++--- test/classes/HeaderTest.php | 6 +-- test/classes/ImportTest.php | 7 +--- test/classes/IndexTest.php | 5 +-- test/classes/InsertEditTest.php | 4 +- test/classes/IpAllowDenyTest.php | 3 +- test/classes/LanguageTest.php | 7 +--- test/classes/LinterTest.php | 9 +--- test/classes/ListDatabaseTest.php | 8 ++-- test/classes/MenuTest.php | 8 +--- test/classes/MessageTest.php | 5 +-- test/classes/MimeTest.php | 5 ++- test/classes/MultSubmitsTest.php | 3 +- test/classes/NormalizationTest.php | 4 +- test/classes/OperationsTest.php | 4 +- test/classes/{PDFTest.php => PdfTest.php} | 5 +-- test/classes/RelationTest.php | 4 +- test/classes/Rte/EventsTest.php | 3 +- test/classes/Rte/RoutinesTest.php | 3 +- test/classes/Rte/TriggersTest.php | 3 +- test/classes/SanitizeTest.php | 8 ++-- test/classes/ScriptsTest.php | 10 ++--- test/classes/Server/CommonTest.php | 3 +- test/classes/Server/PrivilegesTest.php | 3 +- test/classes/Server/Status/AdvisorTest.php | 3 +- test/classes/Server/Status/DataTest.php | 2 - test/classes/Server/Status/MonitorTest.php | 3 +- test/classes/Server/Status/ProcessesTest.php | 3 +- test/classes/Server/Status/QueriesTest.php | 3 +- test/classes/Server/Status/VariablesTest.php | 3 +- test/classes/Server/StatusTest.php | 3 +- test/classes/Server/UserGroupsTest.php | 3 +- test/classes/Server/UsersTest.php | 3 +- .../{ => Setup}/ConfigGeneratorTest.php | 9 +--- test/classes/SqlTest.php | 5 ++- test/classes/StorageEngineTest.php | 4 +- test/classes/Stubs/Response.php | 3 -- test/classes/SystemDatabaseTest.php | 7 ++-- test/classes/TableTest.php | 38 ++++++++--------- test/classes/TemplateTest.php | 5 +-- test/classes/ThemeManagerTest.php | 11 ++--- test/classes/ThemeTest.php | 9 ++-- test/classes/TrackerTest.php | 15 +++---- test/classes/TrackingTest.php | 4 +- test/classes/TransformationsTest.php | 8 ++-- test/classes/TypesMySQLTest.php | 9 +--- test/classes/TypesTest.php | 6 +-- test/classes/UrlTest.php | 9 ++-- test/classes/UtilTest.php | 5 +-- test/classes/VersionInformationTest.php | 15 +++---- test/classes/ZipExtensionTest.php | 6 +-- 73 files changed, 225 insertions(+), 282 deletions(-) rename test/classes/{PDFTest.php => PdfTest.php} (95%) rename test/classes/{ => Setup}/ConfigGeneratorTest.php (97%) diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index 2c35421034..e06638cc30 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -5,11 +5,7 @@ * * @package PhpMyAdmin-test */ - -/* - * Include to test. - */ -require_once 'test/PMATestCase.php'; +namespace PhpMyAdmin\Tests; use PhpMyAdmin\Advisor; use PhpMyAdmin\Theme; @@ -19,7 +15,7 @@ use PhpMyAdmin\Theme; * * @package PhpMyAdmin-test */ -class AdvisorTest extends PMATestCase +class AdvisorTest extends \PMATestCase { /** diff --git a/test/classes/BookmarkTest.php b/test/classes/BookmarkTest.php index 8eece388ed..17b8e336c0 100644 --- a/test/classes/BookmarkTest.php +++ b/test/classes/BookmarkTest.php @@ -5,15 +5,17 @@ * * @package PhpMyAdmin-test */ -use PhpMyAdmin\Bookmark; +namespace PhpMyAdmin\Tests; +use PhpMyAdmin\Bookmark; +use PHPUnit_Framework_TestCase as TestCase; /** * Tests for Bookmark class * * @package PhpMyAdmin-test */ -class BookmarkTest extends PHPUnit_Framework_TestCase +class BookmarkTest extends TestCase { /** * Sets up the fixture, for example, opens a network connection. diff --git a/test/classes/BrowseForeignersTest.php b/test/classes/BrowseForeignersTest.php index 999adada4e..e62c2dd2fa 100644 --- a/test/classes/BrowseForeignersTest.php +++ b/test/classes/BrowseForeignersTest.php @@ -8,13 +8,14 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\BrowseForeigners; +use PHPUnit_Framework_TestCase as TestCase; /** * Tests for PhpMyAdmin\BrowseForeigners * * @package PhpMyAdmin-test */ -class BrowseForeignersTest extends \PHPUnit_Framework_TestCase +class BrowseForeignersTest extends TestCase { /** * Setup for test cases diff --git a/test/classes/CentralColumnsTest.php b/test/classes/CentralColumnsTest.php index 7b4c740e91..7db374a328 100644 --- a/test/classes/CentralColumnsTest.php +++ b/test/classes/CentralColumnsTest.php @@ -12,16 +12,16 @@ use PhpMyAdmin\Theme; use PhpMyAdmin\TypesMySQL; use PhpMyAdmin\Url; use PhpMyAdmin\Util; +use PHPUnit_Framework_TestCase as TestCase; $GLOBALS['server'] = 1; - /** * tests for PhpMyAdmin\CentralColumns * * @package PhpMyAdmin-test */ -class CentralColumnsTest extends \PHPUnit_Framework_TestCase +class CentralColumnsTest extends TestCase { private $_columnData = array( array( diff --git a/test/classes/CharsetsTest.php b/test/classes/CharsetsTest.php index ea0036dfca..1d9bf56ef3 100644 --- a/test/classes/CharsetsTest.php +++ b/test/classes/CharsetsTest.php @@ -5,15 +5,17 @@ * * @package PhpMyAdmin-test */ +namespace PhpMyAdmin\Tests; use PhpMyAdmin\Charsets; +use PHPUnit_Framework_TestCase as TestCase; /** * Tests for MySQL Charsets * * @package PhpMyAdmin-test */ -class CharsetsTest extends PHPUnit_Framework_TestCase +class CharsetsTest extends TestCase { public function setUp() { diff --git a/test/classes/CheckUserPrivilegesTest.php b/test/classes/CheckUserPrivilegesTest.php index d7bc41cbfb..00e98af5fe 100644 --- a/test/classes/CheckUserPrivilegesTest.php +++ b/test/classes/CheckUserPrivilegesTest.php @@ -8,6 +8,7 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\CheckUserPrivileges; +use PHPUnit_Framework_TestCase as TestCase; /* * Include to test. @@ -20,7 +21,7 @@ $GLOBALS['cfg']['Server']['DisableIS'] = false; * * @package PhpMyAdmin-test */ -class CheckUserPrivilegesTest extends \PHPUnit_Framework_TestCase +class CheckUserPrivilegesTest extends TestCase { /** * prepares environment for tests diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index b77f117c7e..02ebc94189 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -6,20 +6,18 @@ * @package PhpMyAdmin-test * @group current */ +namespace PhpMyAdmin\Tests; -/* - * Include to test. - */ +use PhpMyAdmin\Config; use PhpMyAdmin\Theme; - -require_once 'test/PMATestCase.php'; +use PHPUnit_Framework_Assert as Assert; /** * Tests behaviour of PhpMyAdmin\Config class * * @package PhpMyAdmin-test */ -class ConfigTest extends PMATestCase +class ConfigTest extends \PMATestCase { /** * Turn off backup globals @@ -44,14 +42,14 @@ class ConfigTest extends PMATestCase */ protected function setUp() { - $this->object = new PhpMyAdmin\Config; + $this->object = new Config; $GLOBALS['server'] = 0; $_SESSION['is_git_revision'] = true; - $GLOBALS['PMA_Config'] = new PhpMyAdmin\Config(CONFIG_FILE); + $GLOBALS['PMA_Config'] = new Config(CONFIG_FILE); $GLOBALS['cfg']['ProxyUrl'] = ''; //for testing file permissions - $this->permTestObj = new PhpMyAdmin\Config("./config.sample.inc.php"); + $this->permTestObj = new Config("./config.sample.inc.php"); } /** @@ -90,12 +88,12 @@ class ConfigTest extends PMATestCase { $this->assertContains( '
assertContains( '