diff --git a/composer.json b/composer.json index 36afdb9438..8dd98cc9c2 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,11 @@ "PhpMyAdmin\\Setup\\": "setup/lib" } }, + "autoload-dev": { + "psr-4": { + "PhpMyAdmin\\Tests\\": "test/classes" + } + }, "repositories": [ { "type": "composer", diff --git a/test/libraries/stubs/ResponseStub.php b/test/classes/Stubs/Response.php similarity index 98% rename from test/libraries/stubs/ResponseStub.php rename to test/classes/Stubs/Response.php index 526e36ae39..acece0f45b 100644 --- a/test/libraries/stubs/ResponseStub.php +++ b/test/classes/Stubs/Response.php @@ -10,7 +10,7 @@ * @package PhpMyAdmin * @subpackage Stubs */ -namespace PMA\Test\Stubs; +namespace PhpMyAdmin\Tests\Stubs; use PhpMyAdmin\Header; use PhpMyAdmin\Message; @@ -21,7 +21,7 @@ use PhpMyAdmin\Message; /** * Class Response * - * @package PMA\Test\Stubs + * @package PhpMyAdmin\Tests\Stubs */ class Response { diff --git a/test/classes/controllers/DatabaseStructureControllerTest.php b/test/classes/controllers/DatabaseStructureControllerTest.php index e31ba9f4b6..c55bf11e55 100644 --- a/test/classes/controllers/DatabaseStructureControllerTest.php +++ b/test/classes/controllers/DatabaseStructureControllerTest.php @@ -14,11 +14,11 @@ use PhpMyAdmin\Controllers\Database\DatabaseStructureController; use PhpMyAdmin\Di\Container; use PhpMyAdmin\Table; +use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; require_once 'test/PMATestCase.php'; require_once 'libraries/database_interface.inc.php'; -require_once 'test/libraries/stubs/ResponseStub.php'; /** * DatabaseStructureController_Test class @@ -30,7 +30,7 @@ require_once 'test/libraries/stubs/ResponseStub.php'; class DatabaseStructureControllerTest extends PMATestCase { /** - * @var \PMA\Test\Stubs\Response + * @var \PhpMyAdmin\Tests\Stubs\Response */ private $_response; @@ -78,7 +78,7 @@ class DatabaseStructureControllerTest extends PMATestCase $container->set('db', 'db'); $container->set('table', 'table'); $container->set('dbi', $GLOBALS['dbi']); - $this->_response = new \PMA\Test\Stubs\Response(); + $this->_response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $this->_response); $container->alias('response', 'PhpMyAdmin\Response'); } @@ -95,7 +95,7 @@ class DatabaseStructureControllerTest extends PMATestCase $container->set('db', 'db'); $container->set('table', 'table'); $container->set('dbi', $GLOBALS['dbi']); - $response = new \PMA\Test\Stubs\Response(); + $response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $response); $container->alias('response', 'PhpMyAdmin\Response'); diff --git a/test/classes/controllers/ServerDatabasesControllerTest.php b/test/classes/controllers/ServerDatabasesControllerTest.php index 7690682f9e..45639b67a2 100644 --- a/test/classes/controllers/ServerDatabasesControllerTest.php +++ b/test/classes/controllers/ServerDatabasesControllerTest.php @@ -6,13 +6,12 @@ * @package PhpMyAdmin-test */ -use PhpMyAdmin\Di\Container; -use PhpMyAdmin\Theme; use PhpMyAdmin\Charsets; +use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; +use PhpMyAdmin\Theme; require_once 'libraries/database_interface.inc.php'; - -require_once 'test/libraries/stubs/ResponseStub.php'; require_once 'test/PMATestCase.php'; /** @@ -50,7 +49,7 @@ class ServerDatabasesControllerTest extends PMATestCase $container = Container::getDefaultContainer(); $container->set('dbi', $GLOBALS['dbi']); - $this->response = new \PMA\Test\Stubs\Response(); + $this->response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $this->response); $container->alias('response', 'PhpMyAdmin\Response'); } diff --git a/test/classes/controllers/ServerVariablesControllerTest.php b/test/classes/controllers/ServerVariablesControllerTest.php index f10625f50c..0b4f31c080 100644 --- a/test/classes/controllers/ServerVariablesControllerTest.php +++ b/test/classes/controllers/ServerVariablesControllerTest.php @@ -8,11 +8,11 @@ use PhpMyAdmin\Core; use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; use PhpMyAdmin\Url; require_once 'libraries/database_interface.inc.php'; -require_once 'test/libraries/stubs/ResponseStub.php'; require_once 'test/PMATestCase.php'; /** @@ -23,7 +23,7 @@ require_once 'test/PMATestCase.php'; class ServerVariablesControllerTest extends PMATestCase { /** - * @var \PMA\Test\Stubs\Response + * @var \PhpMyAdmin\Tests\Stubs\Response */ private $_response; @@ -90,7 +90,7 @@ class ServerVariablesControllerTest extends PMATestCase $container = Container::getDefaultContainer(); $container->set('dbi', $GLOBALS['dbi']); - $this->_response = new \PMA\Test\Stubs\Response(); + $this->_response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $this->_response); $container->alias('response', 'PhpMyAdmin\Response'); } diff --git a/test/classes/controllers/TableIndexesControllerTest.php b/test/classes/controllers/TableIndexesControllerTest.php index 9ee7f463c3..e14f7d0d26 100644 --- a/test/classes/controllers/TableIndexesControllerTest.php +++ b/test/classes/controllers/TableIndexesControllerTest.php @@ -8,17 +8,16 @@ use PhpMyAdmin\Controllers\Table\TableIndexesController; use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Response; +use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; use PhpMyAdmin\Url; -use PhpMyAdmin\Response; /* * Include to test. */ require_once 'libraries/database_interface.inc.php'; require_once 'libraries/relation.lib.php'; - -require_once 'test/libraries/stubs/ResponseStub.php'; require_once 'test/PMATestCase.php'; /** @@ -99,7 +98,7 @@ class TableIndexesControllerTest extends PMATestCase $container->set('db', 'db'); $container->set('table', 'table'); $container->set('dbi', $GLOBALS['dbi']); - $response = new \PMA\Test\Stubs\Response(); + $response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $response); $container->alias('response', 'PhpMyAdmin\Response'); @@ -151,7 +150,7 @@ class TableIndexesControllerTest extends PMATestCase $container->set('db', 'db'); $container->set('table', 'table'); $container->set('dbi', $GLOBALS['dbi']); - $response = new \PMA\Test\Stubs\Response(); + $response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $response); $container->alias('response', 'PhpMyAdmin\Response'); $index = new PhpMyAdmin\Index(); diff --git a/test/classes/controllers/TableRelationControllerTest.php b/test/classes/controllers/TableRelationControllerTest.php index 72836f29ec..427e6e941c 100644 --- a/test/classes/controllers/TableRelationControllerTest.php +++ b/test/classes/controllers/TableRelationControllerTest.php @@ -10,11 +10,11 @@ * Include to test. */ use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; require_once 'libraries/database_interface.inc.php'; require_once 'libraries/relation.lib.php'; -require_once 'test/libraries/stubs/ResponseStub.php'; require_once 'test/PMATestCase.php'; /** @@ -25,7 +25,7 @@ require_once 'test/PMATestCase.php'; class TableRelationControllerTest extends PMATestCase { /** - * @var \PMA\Test\Stubs\Response + * @var \PhpMyAdmin\Tests\Stubs\Response */ private $_response; @@ -55,7 +55,7 @@ class TableRelationControllerTest extends PMATestCase $container->set('db', 'db'); $container->set('table', 'table'); $container->set('dbi', $GLOBALS['dbi']); - $this->_response = new \PMA\Test\Stubs\Response(); + $this->_response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $this->_response); $container->alias('response', 'PhpMyAdmin\Response'); } diff --git a/test/classes/controllers/TableSearchControllerTest.php b/test/classes/controllers/TableSearchControllerTest.php index b660ff0ff4..53c4870b10 100644 --- a/test/classes/controllers/TableSearchControllerTest.php +++ b/test/classes/controllers/TableSearchControllerTest.php @@ -11,10 +11,10 @@ */ use PhpMyAdmin\Controllers\Table\TableSearchController; use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; use PhpMyAdmin\TypesMySQL; -require_once 'test/libraries/stubs/ResponseStub.php'; require_once 'test/PMATestCase.php'; /** @@ -25,7 +25,7 @@ require_once 'test/PMATestCase.php'; class TableSearchControllerTest extends PMATestCase { /** - * @var PMA\Test\Stubs\Response + * @var PhpMyAdmin\Tests\Stubs\Response */ private $_response; @@ -87,7 +87,7 @@ class TableSearchControllerTest extends PMATestCase $GLOBALS['dbi'] = $dbi; - $this->_response = new PMA\Test\Stubs\Response(); + $this->_response = new ResponseStub(); $container = Container::getDefaultContainer(); $container->set('db', 'PMA'); diff --git a/test/classes/controllers/TableStructureControllerTest.php b/test/classes/controllers/TableStructureControllerTest.php index df33f8cad4..9694809ccc 100644 --- a/test/classes/controllers/TableStructureControllerTest.php +++ b/test/classes/controllers/TableStructureControllerTest.php @@ -12,10 +12,10 @@ * Include to test. */ use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Tests\Stubs\Response as ResponseStub; use PhpMyAdmin\Theme; require_once 'libraries/database_interface.inc.php'; -require_once 'test/libraries/stubs/ResponseStub.php'; require_once 'test/PMATestCase.php'; /** @@ -28,7 +28,7 @@ require_once 'test/PMATestCase.php'; class TableStructureControllerTest extends PMATestCase { /** - * @var \PMA\Test\Stubs\Response + * @var \PhpMyAdmin\Tests\Stubs\Response */ private $_response; @@ -67,7 +67,7 @@ class TableStructureControllerTest extends PMATestCase $container->set('db', 'db'); $container->set('table', 'table'); $container->set('dbi', $GLOBALS['dbi']); - $this->_response = new \PMA\Test\Stubs\Response(); + $this->_response = new ResponseStub(); $container->set('PhpMyAdmin\Response', $this->_response); $container->alias('response', 'PhpMyAdmin\Response'); }