diff --git a/composer.json b/composer.json index bedf3f9a..65edeae5 100644 --- a/composer.json +++ b/composer.json @@ -91,12 +91,10 @@ "module/Core/test", "module/Core/test-db" ], - "ShlinkioTest\\Shlink\\Common\\": [ - "module/Common/test", - "module/Common/test-db" - ], + "ShlinkioTest\\Shlink\\Common\\": "module/Common/test", "ShlinkioTest\\Shlink\\EventDispatcher\\": "module/EventDispatcher/test", - "ShlinkioTest\\Shlink\\IpGeolocation\\": "module/IpGeolocation/test" + "ShlinkioTest\\Shlink\\IpGeolocation\\": "module/IpGeolocation/test", + "Shlinkio\\Shlink\\TestUtils\\": "module/TestUtils/src" } }, "scripts": { diff --git a/config/test/bootstrap_api_tests.php b/config/test/bootstrap_api_tests.php index 5551094f..3e097d98 100644 --- a/config/test/bootstrap_api_tests.php +++ b/config/test/bootstrap_api_tests.php @@ -1,7 +1,7 @@ get(TestHelper::class); +$testHelper = $container->get(Helper\TestHelper::class); $config = $container->get('config'); $em = $container->get(EntityManager::class); diff --git a/config/test/bootstrap_db_tests.php b/config/test/bootstrap_db_tests.php index f2788257..b10d8d32 100644 --- a/config/test/bootstrap_db_tests.php +++ b/config/test/bootstrap_db_tests.php @@ -1,7 +1,7 @@ get(TestHelper::class)->createTestDb(); +$container->get(Helper\TestHelper::class)->createTestDb(); DbTest\DatabaseTestCase::setEntityManager($container->get('em')); diff --git a/config/test/test_config.global.php b/config/test/test_config.global.php index 24057833..5c431379 100644 --- a/config/test/test_config.global.php +++ b/config/test/test_config.global.php @@ -1,7 +1,7 @@ [ - Common\TestHelper::class => InvokableFactory::class, + TestUtils\Helper\TestHelper::class => InvokableFactory::class, ], ], diff --git a/module/Core/test-db/Repository/ShortUrlRepositoryTest.php b/module/Core/test-db/Repository/ShortUrlRepositoryTest.php index fd7e8789..2a243ce3 100644 --- a/module/Core/test-db/Repository/ShortUrlRepositoryTest.php +++ b/module/Core/test-db/Repository/ShortUrlRepositoryTest.php @@ -11,7 +11,7 @@ use Shlinkio\Shlink\Core\Entity\Visit; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Repository\ShortUrlRepository; -use ShlinkioTest\Shlink\Common\DbTest\DatabaseTestCase; +use Shlinkio\Shlink\TestUtils\DbTest\DatabaseTestCase; use function count; diff --git a/module/Core/test-db/Repository/TagRepositoryTest.php b/module/Core/test-db/Repository/TagRepositoryTest.php index 1896bc9d..213c686d 100644 --- a/module/Core/test-db/Repository/TagRepositoryTest.php +++ b/module/Core/test-db/Repository/TagRepositoryTest.php @@ -5,7 +5,7 @@ namespace ShlinkioTest\Shlink\Core\Repository; use Shlinkio\Shlink\Core\Entity\Tag; use Shlinkio\Shlink\Core\Repository\TagRepository; -use ShlinkioTest\Shlink\Common\DbTest\DatabaseTestCase; +use Shlinkio\Shlink\TestUtils\DbTest\DatabaseTestCase; class TagRepositoryTest extends DatabaseTestCase { diff --git a/module/Core/test-db/Repository/VisitRepositoryTest.php b/module/Core/test-db/Repository/VisitRepositoryTest.php index 3b0e758a..0a9200cb 100644 --- a/module/Core/test-db/Repository/VisitRepositoryTest.php +++ b/module/Core/test-db/Repository/VisitRepositoryTest.php @@ -11,7 +11,7 @@ use Shlinkio\Shlink\Core\Entity\VisitLocation; use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Repository\VisitRepository; use Shlinkio\Shlink\IpGeolocation\Model\Location; -use ShlinkioTest\Shlink\Common\DbTest\DatabaseTestCase; +use Shlinkio\Shlink\TestUtils\DbTest\DatabaseTestCase; use function Functional\map; use function range; diff --git a/module/Rest/test-api/Action/CreateShortUrlActionTest.php b/module/Rest/test-api/Action/CreateShortUrlActionTest.php index 30839ebd..099eb9c4 100644 --- a/module/Rest/test-api/Action/CreateShortUrlActionTest.php +++ b/module/Rest/test-api/Action/CreateShortUrlActionTest.php @@ -5,7 +5,7 @@ namespace ShlinkioApiTest\Shlink\Rest\Action; use Cake\Chronos\Chronos; use GuzzleHttp\RequestOptions; -use ShlinkioTest\Shlink\Common\ApiTest\ApiTestCase; +use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase; use function Functional\map; use function range; diff --git a/module/Rest/test-api/Action/ListShortUrlsTest.php b/module/Rest/test-api/Action/ListShortUrlsTest.php index eb1e605b..8f7db414 100644 --- a/module/Rest/test-api/Action/ListShortUrlsTest.php +++ b/module/Rest/test-api/Action/ListShortUrlsTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); namespace ShlinkioApiTest\Shlink\Rest\Action; -use ShlinkioTest\Shlink\Common\ApiTest\ApiTestCase; +use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase; class ListShortUrlsTest extends ApiTestCase { diff --git a/module/Rest/test-api/Middleware/AuthenticationTest.php b/module/Rest/test-api/Middleware/AuthenticationTest.php index 34e67441..680d67b3 100644 --- a/module/Rest/test-api/Middleware/AuthenticationTest.php +++ b/module/Rest/test-api/Middleware/AuthenticationTest.php @@ -6,7 +6,7 @@ namespace ShlinkioApiTest\Shlink\Rest\Middleware; use Shlinkio\Shlink\Rest\Authentication\Plugin\ApiKeyHeaderPlugin; use Shlinkio\Shlink\Rest\Authentication\RequestToHttpAuthPlugin; use Shlinkio\Shlink\Rest\Util\RestUtils; -use ShlinkioTest\Shlink\Common\ApiTest\ApiTestCase; +use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase; use function implode; use function sprintf; diff --git a/module/Rest/test-api/Action/OptionsRequestTest.php b/module/Rest/test-api/Middleware/ImplicitOptionsTest.php similarity index 83% rename from module/Rest/test-api/Action/OptionsRequestTest.php rename to module/Rest/test-api/Middleware/ImplicitOptionsTest.php index 1be10ee0..02415168 100644 --- a/module/Rest/test-api/Action/OptionsRequestTest.php +++ b/module/Rest/test-api/Middleware/ImplicitOptionsTest.php @@ -1,13 +1,13 @@