diff --git a/composer.json b/composer.json index 4504345be..89bdaf4a2 100644 --- a/composer.json +++ b/composer.json @@ -67,8 +67,7 @@ "wikimedia/less.php": "^3.0" }, "require-dev": { - "mockery/mockery": "^1.4", - "phpunit/phpunit": "^9.0" + "flarum/testing": "^0.1.0-beta.16" }, "autoload": { "psr-4": { diff --git a/tests/integration/BuildsHttpRequests.php b/tests/integration/BuildsHttpRequests.php deleted file mode 100644 index 26fd34743..000000000 --- a/tests/integration/BuildsHttpRequests.php +++ /dev/null @@ -1,69 +0,0 @@ -withHeader('Content-Type', 'application/json') - ->withBody( - new CallbackStream(function () use ($json) { - return json_encode($json); - }) - ); - } - - protected function requestAsUser(Request $req, int $userId): Request - { - $token = Str::random(40); - - /** - * We insert this directly instead of via `prepareDatabase` - * so that requests can be created/sent after the app is booted. - */ - $this->database()->table('access_tokens')->insert([ - 'token' => $token, - 'user_id' => $userId, - 'created_at' => Carbon::now()->toDateTimeString(), - 'last_activity_at' => Carbon::now()->toDateTimeString(), - 'type' => 'session' - ]); - - return $req->withAddedHeader('Authorization', "Token {$token}"); - } - - protected function requestWithCookiesFrom(Request $req, Response $previous): Request - { - $cookies = array_reduce( - $previous->getHeader('Set-Cookie'), - function ($memo, $setCookieString) { - $setCookie = SetCookie::fromSetCookieString($setCookieString); - $memo[$setCookie->getName()] = $setCookie->getValue(); - - return $memo; - }, - [] - ); - - return $req->withCookieParams($cookies); - } -} diff --git a/tests/integration/ConsoleTestCase.php b/tests/integration/ConsoleTestCase.php deleted file mode 100644 index 80d907a2e..000000000 --- a/tests/integration/ConsoleTestCase.php +++ /dev/null @@ -1,44 +0,0 @@ -console)) { - $this->console = new ConsoleApplication('Flarum', Application::VERSION); - $this->console->setAutoExit(false); - - foreach ($this->app()->getConsoleCommands() as $command) { - $this->console->add($command); - } - } - - return $this->console; - } - - protected function runCommand(array $inputArray) - { - $input = new ArrayInput($inputArray); - $output = new BufferedOutput(); - - $this->console()->run($input, $output); - - return trim($output->fetch()); - } -} diff --git a/tests/integration/RetrievesAuthorizedUsers.php b/tests/integration/RetrievesAuthorizedUsers.php deleted file mode 100644 index a4bd58a98..000000000 --- a/tests/integration/RetrievesAuthorizedUsers.php +++ /dev/null @@ -1,24 +0,0 @@ - 2, - 'username' => 'normal', - 'password' => '$2y$10$LO59tiT7uggl6Oe23o/O6.utnF6ipngYjvMvaxo1TciKqBttDNKim', // BCrypt hash for "too-obscure" - 'email' => 'normal@machine.local', - 'is_email_confirmed' => 1, - ]; - } -} diff --git a/tests/integration/TestCase.php b/tests/integration/TestCase.php deleted file mode 100644 index 1bf515a41..000000000 --- a/tests/integration/TestCase.php +++ /dev/null @@ -1,204 +0,0 @@ -database()->rollBack(); - } - - /** - * @var \Flarum\Foundation\InstalledApp - */ - protected $app; - - /** - * @return \Flarum\Foundation\InstalledApp - */ - protected function app() - { - if (is_null($this->app)) { - $site = new InstalledSite( - new Paths([ - 'base' => __DIR__.'/tmp', - 'vendor' => __DIR__.'/../../vendor', - 'public' => __DIR__.'/tmp/public', - 'storage' => __DIR__.'/tmp/storage', - ]), - new Config(include __DIR__.'/tmp/config.php') - ); - - $site->extendWith($this->extenders); - - $this->app = $site->bootApp(); - - $this->database()->beginTransaction(); - - $this->populateDatabase(); - } - - return $this->app; - } - - /** - * @var ExtenderInterface[] - */ - protected $extenders = []; - - protected function extend(ExtenderInterface ...$extenders) - { - $this->extenders = array_merge($this->extenders, $extenders); - } - - /** - * @var RequestHandlerInterface - */ - protected $server; - - protected function server(): RequestHandlerInterface - { - if (is_null($this->server)) { - $this->server = $this->app()->getRequestHandler(); - } - - return $this->server; - } - - protected $database; - - protected function database(): ConnectionInterface - { - if (is_null($this->database)) { - $this->database = $this->app()->getContainer()->make( - ConnectionInterface::class - ); - } - - return $this->database; - } - - protected $databaseContent = []; - - protected function prepareDatabase(array $tableData) - { - $this->databaseContent = array_merge_recursive( - $this->databaseContent, - $tableData - ); - } - - protected function populateDatabase() - { - // We temporarily disable foreign key checks to simplify this process. - $this->database()->getSchemaBuilder()->disableForeignKeyConstraints(); - - // Then, insert all rows required for this test case. - foreach ($this->databaseContent as $table => $rows) { - foreach ($rows as $row) { - if ($table === 'settings') { - $this->database()->table($table)->updateOrInsert( - ['key' => $row['key']], - $row - ); - } else { - $this->database()->table($table)->updateOrInsert( - isset($row['id']) ? ['id' => $row['id']] : $row, - $row - ); - } - } - } - - // And finally, turn on foreign key checks again. - $this->database()->getSchemaBuilder()->enableForeignKeyConstraints(); - } - - /** - * Send a full HTTP request through Flarum's middleware stack. - */ - protected function send(ServerRequestInterface $request): ResponseInterface - { - return $this->server()->handle($request); - } - - /** - * Build a HTTP request that can be passed through middleware. - * - * This method simplifies building HTTP requests for use in our HTTP-level - * integration tests. It provides options for all features repeatedly being - * used in those tests. - * - * @param string $method - * @param string $path - * @param array $options - * An array of optional request properties. - * Currently supported: - * - "json" should point to a JSON-serializable object that will be - * serialized and used as request body. The corresponding Content-Type - * header will be set automatically. - * - "authenticatedAs" should identify an *existing* user by ID. This will - * cause an access token to be created for this user, which will be used - * to authenticate the request via the "Authorization" header. - * - "cookiesFrom" should hold a response object from a previous HTTP - * interaction. All cookies returned from the server in that response - * (via the "Set-Cookie" header) will be copied to the cookie params of - * the new request. - * @return ServerRequestInterface - */ - protected function request(string $method, string $path, array $options = []): ServerRequestInterface - { - $request = new ServerRequest([], [], $path, $method); - - // Do we want a JSON request body? - if (isset($options['json'])) { - $request = $this->requestWithJsonBody( - $request, - $options['json'] - ); - } - - // Authenticate as a given user - if (isset($options['authenticatedAs'])) { - $request = $this->requestAsUser( - $request, - $options['authenticatedAs'] - ); - } - - // Let's copy the cookies from a previous response - if (isset($options['cookiesFrom'])) { - $request = $this->requestWithCookiesFrom( - $request, - $options['cookiesFrom'] - ); - } - - return $request; - } -} diff --git a/tests/integration/UsesSettings.php b/tests/integration/UsesSettings.php deleted file mode 100644 index d37aa0f7b..000000000 --- a/tests/integration/UsesSettings.php +++ /dev/null @@ -1,25 +0,0 @@ -app()->getContainer()->forgetInstance(SettingsRepositoryInterface::class); - } -} diff --git a/tests/integration/api/access_tokens/AccessTokenLifecycleTest.php b/tests/integration/api/access_tokens/AccessTokenLifecycleTest.php index 3782566cc..129b1b100 100644 --- a/tests/integration/api/access_tokens/AccessTokenLifecycleTest.php +++ b/tests/integration/api/access_tokens/AccessTokenLifecycleTest.php @@ -11,8 +11,8 @@ namespace Flarum\Tests\integration\api\access_tokens; use Carbon\Carbon; use Flarum\Http\AccessToken; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Laminas\Diactoros\ServerRequest; class AccessTokenLifecycleTest extends TestCase diff --git a/tests/integration/api/access_tokens/RemembererTest.php b/tests/integration/api/access_tokens/RemembererTest.php index 56056a170..70bf89f71 100644 --- a/tests/integration/api/access_tokens/RemembererTest.php +++ b/tests/integration/api/access_tokens/RemembererTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\access_tokens; use Carbon\Carbon; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class RemembererTest extends TestCase { diff --git a/tests/integration/api/authentication/WithApiKeyTest.php b/tests/integration/api/authentication/WithApiKeyTest.php index 80fcc4e61..464697e50 100644 --- a/tests/integration/api/authentication/WithApiKeyTest.php +++ b/tests/integration/api/authentication/WithApiKeyTest.php @@ -11,8 +11,8 @@ namespace Flarum\Tests\integration\api\authentication; use Carbon\Carbon; use Flarum\Api\ApiKey; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class WithApiKeyTest extends TestCase { diff --git a/tests/integration/api/authentication/WithTokenTest.php b/tests/integration/api/authentication/WithTokenTest.php index 2b014ae69..aa16e8975 100644 --- a/tests/integration/api/authentication/WithTokenTest.php +++ b/tests/integration/api/authentication/WithTokenTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\authentication; use Flarum\Http\AccessToken; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class WithTokenTest extends TestCase { diff --git a/tests/integration/api/csrf_protection/RequireCsrfTokenTest.php b/tests/integration/api/csrf_protection/RequireCsrfTokenTest.php index 6e00da18f..2b769f27e 100644 --- a/tests/integration/api/csrf_protection/RequireCsrfTokenTest.php +++ b/tests/integration/api/csrf_protection/RequireCsrfTokenTest.php @@ -9,8 +9,8 @@ namespace Flarum\Tests\integration\api\csrf_protection; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class RequireCsrfTokenTest extends TestCase { diff --git a/tests/integration/api/discussions/CreateTest.php b/tests/integration/api/discussions/CreateTest.php index 659c4f43d..0b3b9994f 100644 --- a/tests/integration/api/discussions/CreateTest.php +++ b/tests/integration/api/discussions/CreateTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\discussions; use Flarum\Discussion\Discussion; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Support\Arr; class CreateTest extends TestCase diff --git a/tests/integration/api/discussions/DeletionTest.php b/tests/integration/api/discussions/DeletionTest.php index f81922ab6..38a19694f 100644 --- a/tests/integration/api/discussions/DeletionTest.php +++ b/tests/integration/api/discussions/DeletionTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\discussions; use Carbon\Carbon; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class DeletionTest extends TestCase { diff --git a/tests/integration/api/discussions/ListTest.php b/tests/integration/api/discussions/ListTest.php index db3bd2c1a..63078ddce 100644 --- a/tests/integration/api/discussions/ListTest.php +++ b/tests/integration/api/discussions/ListTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\discussions; use Carbon\Carbon; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; use Illuminate\Support\Arr; diff --git a/tests/integration/api/discussions/ListTestWithFulltextSearch.php b/tests/integration/api/discussions/ListTestWithFulltextSearch.php index 1b591fe35..629e01855 100644 --- a/tests/integration/api/discussions/ListTestWithFulltextSearch.php +++ b/tests/integration/api/discussions/ListTestWithFulltextSearch.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\discussions; use Carbon\Carbon; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class ListTest extends TestCase { diff --git a/tests/integration/api/discussions/ShowTest.php b/tests/integration/api/discussions/ShowTest.php index a9f091c14..3354d24ee 100644 --- a/tests/integration/api/discussions/ShowTest.php +++ b/tests/integration/api/discussions/ShowTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\discussions; use Carbon\Carbon; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Support\Arr; class ShowTest extends TestCase diff --git a/tests/integration/api/forum/ShowTest.php b/tests/integration/api/forum/ShowTest.php index 7bb072f10..f2d41836f 100644 --- a/tests/integration/api/forum/ShowTest.php +++ b/tests/integration/api/forum/ShowTest.php @@ -9,8 +9,8 @@ namespace Flarum\Tests\integration\api\forum; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Support\Arr; class ShowTest extends TestCase diff --git a/tests/integration/api/groups/CreateTest.php b/tests/integration/api/groups/CreateTest.php index a92e33877..f7924b5e6 100644 --- a/tests/integration/api/groups/CreateTest.php +++ b/tests/integration/api/groups/CreateTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\groups; use Flarum\Group\Group; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Support\Arr; class CreateTest extends TestCase diff --git a/tests/integration/api/groups/ListTest.php b/tests/integration/api/groups/ListTest.php index 0b1f7bf74..7773222d9 100644 --- a/tests/integration/api/groups/ListTest.php +++ b/tests/integration/api/groups/ListTest.php @@ -9,8 +9,8 @@ namespace Flarum\Tests\integration\api\groups; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Support\Arr; class ListTest extends TestCase diff --git a/tests/integration/api/notifications/ListTest.php b/tests/integration/api/notifications/ListTest.php index 8a0a0a563..4c94c3ce7 100644 --- a/tests/integration/api/notifications/ListTest.php +++ b/tests/integration/api/notifications/ListTest.php @@ -9,8 +9,8 @@ namespace Flarum\Tests\integration\api\notifications; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class ListTest extends TestCase { diff --git a/tests/integration/api/posts/CreateTest.php b/tests/integration/api/posts/CreateTest.php index d1a57151d..a69d42783 100644 --- a/tests/integration/api/posts/CreateTest.php +++ b/tests/integration/api/posts/CreateTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\posts; use Carbon\Carbon; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class CreateTest extends TestCase { diff --git a/tests/integration/api/posts/ListTest.php b/tests/integration/api/posts/ListTest.php index 4ed599b76..a158afda5 100644 --- a/tests/integration/api/posts/ListTest.php +++ b/tests/integration/api/posts/ListTest.php @@ -11,8 +11,8 @@ namespace Flarum\Tests\integration\api\posts; use Carbon\Carbon; use Flarum\Event\ConfigurePostsQuery; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Support\Arr; class ListTests extends TestCase diff --git a/tests/integration/api/users/CreateTest.php b/tests/integration/api/users/CreateTest.php index 6d4440a99..af8d6c727 100644 --- a/tests/integration/api/users/CreateTest.php +++ b/tests/integration/api/users/CreateTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\users; use Flarum\Settings\SettingsRepositoryInterface; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class CreateTest extends TestCase diff --git a/tests/integration/api/users/GroupSearchTest.php b/tests/integration/api/users/GroupSearchTest.php index bc6accda5..489b50306 100644 --- a/tests/integration/api/users/GroupSearchTest.php +++ b/tests/integration/api/users/GroupSearchTest.php @@ -9,8 +9,8 @@ namespace Flarum\Tests\integration\api\users; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class GroupSearchTest extends TestCase { diff --git a/tests/integration/api/users/ListTest.php b/tests/integration/api/users/ListTest.php index f7e1b5137..d91760b55 100644 --- a/tests/integration/api/users/ListTest.php +++ b/tests/integration/api/users/ListTest.php @@ -9,8 +9,8 @@ namespace Flarum\Tests\integration\api\users; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Support\Arr; class ListTest extends TestCase diff --git a/tests/integration/api/users/ShowTest.php b/tests/integration/api/users/ShowTest.php index c3bcefaee..8e6cbb215 100644 --- a/tests/integration/api/users/ShowTest.php +++ b/tests/integration/api/users/ShowTest.php @@ -9,8 +9,8 @@ namespace Flarum\Tests\integration\api\users; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class ShowTest extends TestCase { diff --git a/tests/integration/api/users/UpdateTest.php b/tests/integration/api/users/UpdateTest.php index 6d5e2e9dd..2681c50d3 100644 --- a/tests/integration/api/users/UpdateTest.php +++ b/tests/integration/api/users/UpdateTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\api\users; use Carbon\Carbon; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class UpdateTest extends TestCase { diff --git a/tests/integration/extenders/ApiControllerTest.php b/tests/integration/extenders/ApiControllerTest.php index 7247738da..27323a70d 100644 --- a/tests/integration/extenders/ApiControllerTest.php +++ b/tests/integration/extenders/ApiControllerTest.php @@ -22,8 +22,8 @@ use Flarum\Api\Serializer\PostSerializer; use Flarum\Api\Serializer\UserSerializer; use Flarum\Discussion\Discussion; use Flarum\Extend; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; use Illuminate\Support\Arr; diff --git a/tests/integration/extenders/ApiSerializerTest.php b/tests/integration/extenders/ApiSerializerTest.php index d1f11b67a..e76ecb6c1 100644 --- a/tests/integration/extenders/ApiSerializerTest.php +++ b/tests/integration/extenders/ApiSerializerTest.php @@ -19,8 +19,8 @@ use Flarum\Api\Serializer\UserSerializer; use Flarum\Discussion\Discussion; use Flarum\Extend; use Flarum\Post\Post; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class ApiSerializerTest extends TestCase diff --git a/tests/integration/extenders/AuthTest.php b/tests/integration/extenders/AuthTest.php index 5800d1cf3..41e024e88 100644 --- a/tests/integration/extenders/AuthTest.php +++ b/tests/integration/extenders/AuthTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class AuthTest extends TestCase diff --git a/tests/integration/extenders/ConsoleTest.php b/tests/integration/extenders/ConsoleTest.php index 8a941b17a..e7875120c 100644 --- a/tests/integration/extenders/ConsoleTest.php +++ b/tests/integration/extenders/ConsoleTest.php @@ -11,7 +11,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Console\AbstractCommand; use Flarum\Extend; -use Flarum\Tests\integration\ConsoleTestCase; +use Flarum\Testing\integration\ConsoleTestCase; class ConsoleTest extends ConsoleTestCase { diff --git a/tests/integration/extenders/CsrfTest.php b/tests/integration/extenders/CsrfTest.php index ff667fe13..1c9f7c38f 100644 --- a/tests/integration/extenders/CsrfTest.php +++ b/tests/integration/extenders/CsrfTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class CsrfTest extends TestCase diff --git a/tests/integration/extenders/EventTest.php b/tests/integration/extenders/EventTest.php index 011f03e87..9f4cf9d95 100644 --- a/tests/integration/extenders/EventTest.php +++ b/tests/integration/extenders/EventTest.php @@ -13,8 +13,8 @@ use Flarum\Extend; use Flarum\Foundation\Application; use Flarum\Group\Command\CreateGroup; use Flarum\Group\Event\Created; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher; use Illuminate\Contracts\Events\Dispatcher; diff --git a/tests/integration/extenders/FilterTest.php b/tests/integration/extenders/FilterTest.php index aa1fed9a4..e6ec34fb5 100644 --- a/tests/integration/extenders/FilterTest.php +++ b/tests/integration/extenders/FilterTest.php @@ -14,8 +14,8 @@ use Flarum\Discussion\Filter\DiscussionFilterer; use Flarum\Extend; use Flarum\Filter\FilterInterface; use Flarum\Filter\FilterState; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class FilterTest extends TestCase { diff --git a/tests/integration/extenders/FormatterTest.php b/tests/integration/extenders/FormatterTest.php index 722f83783..7a4e12fdf 100644 --- a/tests/integration/extenders/FormatterTest.php +++ b/tests/integration/extenders/FormatterTest.php @@ -11,7 +11,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; use Flarum\Formatter\Formatter; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; class FormatterTest extends TestCase { diff --git a/tests/integration/extenders/MailTest.php b/tests/integration/extenders/MailTest.php index 742c89aa7..bea3c083a 100644 --- a/tests/integration/extenders/MailTest.php +++ b/tests/integration/extenders/MailTest.php @@ -12,8 +12,8 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; use Flarum\Mail\DriverInterface; use Flarum\Settings\SettingsRepositoryInterface; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Illuminate\Contracts\Validation\Factory; use Illuminate\Support\MessageBag; use Swift_NullTransport; diff --git a/tests/integration/extenders/MiddlewareTest.php b/tests/integration/extenders/MiddlewareTest.php index 3057a3dd7..e69d5001e 100644 --- a/tests/integration/extenders/MiddlewareTest.php +++ b/tests/integration/extenders/MiddlewareTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; diff --git a/tests/integration/extenders/ModelPrivateTest.php b/tests/integration/extenders/ModelPrivateTest.php index a2983e9d9..6d22df1bf 100644 --- a/tests/integration/extenders/ModelPrivateTest.php +++ b/tests/integration/extenders/ModelPrivateTest.php @@ -11,8 +11,8 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Discussion\Discussion; use Flarum\Extend; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class ModelPrivateTest extends TestCase diff --git a/tests/integration/extenders/ModelTest.php b/tests/integration/extenders/ModelTest.php index c198f9922..a2228247e 100644 --- a/tests/integration/extenders/ModelTest.php +++ b/tests/integration/extenders/ModelTest.php @@ -17,8 +17,8 @@ use Flarum\Post\AbstractEventPost; use Flarum\Post\CommentPost; use Flarum\Post\DiscussionRenamedPost; use Flarum\Post\Post; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class ModelTest extends TestCase diff --git a/tests/integration/extenders/ModelUrlTest.php b/tests/integration/extenders/ModelUrlTest.php index a5b095ce8..87ac36f82 100644 --- a/tests/integration/extenders/ModelUrlTest.php +++ b/tests/integration/extenders/ModelUrlTest.php @@ -13,9 +13,9 @@ use Flarum\Database\AbstractModel; use Flarum\Extend; use Flarum\Http\SlugDriverInterface; use Flarum\Http\SlugManager; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; -use Flarum\Tests\integration\UsesSettings; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; +use Flarum\Testing\integration\UsesSettings; use Flarum\User\User; class ModelUrlTest extends TestCase diff --git a/tests/integration/extenders/ModelVisibilityTest.php b/tests/integration/extenders/ModelVisibilityTest.php index e875997a1..db8d5b6e3 100644 --- a/tests/integration/extenders/ModelVisibilityTest.php +++ b/tests/integration/extenders/ModelVisibilityTest.php @@ -14,8 +14,8 @@ use Flarum\Discussion\Discussion; use Flarum\Extend; use Flarum\Post\CommentPost; use Flarum\Post\Post; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Arr; diff --git a/tests/integration/extenders/NotificationTest.php b/tests/integration/extenders/NotificationTest.php index d7a7e6c3a..d1f9e90b2 100644 --- a/tests/integration/extenders/NotificationTest.php +++ b/tests/integration/extenders/NotificationTest.php @@ -14,8 +14,8 @@ use Flarum\Notification\Blueprint\BlueprintInterface; use Flarum\Notification\Driver\NotificationDriverInterface; use Flarum\Notification\Notification; use Flarum\Notification\NotificationSyncer; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class NotificationTest extends TestCase diff --git a/tests/integration/extenders/PolicyTest.php b/tests/integration/extenders/PolicyTest.php index 984885277..7466b182c 100644 --- a/tests/integration/extenders/PolicyTest.php +++ b/tests/integration/extenders/PolicyTest.php @@ -14,9 +14,9 @@ use Flarum\Discussion\Discussion; use Flarum\Extend; use Flarum\Post\CommentPost; use Flarum\Post\Post; -use Flarum\Tests\integration\BuildsHttpRequests; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\BuildsHttpRequests; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\Access\AbstractPolicy; use Flarum\User\User; diff --git a/tests/integration/extenders/PostTest.php b/tests/integration/extenders/PostTest.php index a91f12d77..d9323dbcc 100644 --- a/tests/integration/extenders/PostTest.php +++ b/tests/integration/extenders/PostTest.php @@ -13,7 +13,7 @@ use Flarum\Extend; use Flarum\Post\AbstractEventPost; use Flarum\Post\MergeableInterface; use Flarum\Post\Post; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; class PostTest extends TestCase { diff --git a/tests/integration/extenders/RoutesTest.php b/tests/integration/extenders/RoutesTest.php index b63028b0f..f451d611d 100644 --- a/tests/integration/extenders/RoutesTest.php +++ b/tests/integration/extenders/RoutesTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; use Laminas\Diactoros\Response\TextResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; diff --git a/tests/integration/extenders/ServiceProviderTest.php b/tests/integration/extenders/ServiceProviderTest.php index 72f3af0b6..9115ef320 100644 --- a/tests/integration/extenders/ServiceProviderTest.php +++ b/tests/integration/extenders/ServiceProviderTest.php @@ -11,7 +11,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; use Flarum\Foundation\AbstractServiceProvider; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; class ServiceProviderTest extends TestCase { diff --git a/tests/integration/extenders/SettingsTest.php b/tests/integration/extenders/SettingsTest.php index 22b14de3b..c1953afb9 100644 --- a/tests/integration/extenders/SettingsTest.php +++ b/tests/integration/extenders/SettingsTest.php @@ -10,9 +10,9 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; -use Flarum\Tests\integration\UsesSettings; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; +use Flarum\Testing\integration\UsesSettings; class SettingsTest extends TestCase { diff --git a/tests/integration/extenders/SimpleFlarumSearchTest.php b/tests/integration/extenders/SimpleFlarumSearchTest.php index 587de38a5..5fb32a262 100644 --- a/tests/integration/extenders/SimpleFlarumSearchTest.php +++ b/tests/integration/extenders/SimpleFlarumSearchTest.php @@ -16,8 +16,8 @@ use Flarum\Query\QueryCriteria; use Flarum\Search\AbstractRegexGambit; use Flarum\Search\GambitInterface; use Flarum\Search\SearchState; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; use Flarum\User\User; class SimpleFlarumSearchTest extends TestCase diff --git a/tests/integration/extenders/ThrottleApiTest.php b/tests/integration/extenders/ThrottleApiTest.php index b2e88798b..c61299da5 100644 --- a/tests/integration/extenders/ThrottleApiTest.php +++ b/tests/integration/extenders/ThrottleApiTest.php @@ -10,8 +10,8 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; class ThrottleApiTest extends TestCase { diff --git a/tests/integration/extenders/UserTest.php b/tests/integration/extenders/UserTest.php index f8b22d5bc..2f3226d47 100644 --- a/tests/integration/extenders/UserTest.php +++ b/tests/integration/extenders/UserTest.php @@ -10,9 +10,9 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\RetrievesAuthorizedUsers; -use Flarum\Tests\integration\TestCase; -use Flarum\Tests\integration\UsesSettings; +use Flarum\Testing\integration\RetrievesAuthorizedUsers; +use Flarum\Testing\integration\TestCase; +use Flarum\Testing\integration\UsesSettings; use Flarum\User\DisplayName\DriverInterface; use Flarum\User\User; use Illuminate\Support\Arr; diff --git a/tests/integration/extenders/ValidatorTest.php b/tests/integration/extenders/ValidatorTest.php index 6a93e8bb6..ddb3b577c 100644 --- a/tests/integration/extenders/ValidatorTest.php +++ b/tests/integration/extenders/ValidatorTest.php @@ -11,7 +11,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; use Flarum\Group\GroupValidator; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; use Flarum\User\UserValidator; use Illuminate\Validation\ValidationException; diff --git a/tests/integration/extenders/ViewTest.php b/tests/integration/extenders/ViewTest.php index 06541ec6f..f9c101eac 100644 --- a/tests/integration/extenders/ViewTest.php +++ b/tests/integration/extenders/ViewTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\integration\extenders; use Flarum\Extend; -use Flarum\Tests\integration\TestCase; +use Flarum\Testing\integration\TestCase; use Illuminate\Contracts\View\Factory; class ViewTest extends TestCase diff --git a/tests/integration/setup.php b/tests/integration/setup.php index 95739eaac..67039c083 100644 --- a/tests/integration/setup.php +++ b/tests/integration/setup.php @@ -7,65 +7,10 @@ * LICENSE file that was distributed with this source code. */ -use Flarum\Foundation\Paths; -use Flarum\Install\AdminUser; -use Flarum\Install\BaseUrl; -use Flarum\Install\DatabaseConfig; -use Flarum\Install\Installation; +use Flarum\Testing\integration\Setup\SetupScript; require __DIR__.'/../../vendor/autoload.php'; -$host = getenv('DB_HOST') ?: 'localhost'; -$port = intval(getenv('DB_PORT') ?: 3306); -$name = getenv('DB_DATABASE') ?: 'flarum_test'; -$user = getenv('DB_USERNAME') ?: 'root'; -$pass = getenv('DB_PASSWORD') ?: ''; -$pref = getenv('DB_PREFIX') ?: ''; +$setup = new SetupScript(); -echo "Connecting to database $name at $host:$port.\n"; -echo "Logging in as $user with password '$pass'.\n"; -echo "Table prefix: '$pref'\n"; - -echo "\n\nCancel now if that's not what you want...\n"; -echo "Use the following environment variables for configuration:\n"; -echo "DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD, DB_PREFIX\n"; - -sleep(5); - -echo "\nOff we go...\n"; - -/* - * Setup installation configuration - */ - -$installation = new Installation( - new Paths([ - 'base' => __DIR__.'/tmp', - 'public' => __DIR__.'/tmp/public', - 'storage' => __DIR__.'/tmp/storage', - 'vendor' => __DIR__.'/../../vendor', - ]) -); - -$pipeline = $installation - ->configPath('config.php') - ->debugMode(true) - ->baseUrl(BaseUrl::fromString('http://localhost')) - ->databaseConfig( - new DatabaseConfig('mysql', $host, $port, $name, $user, $pass, $pref) - ) - ->adminUser(new AdminUser( - 'admin', - 'password', - 'admin@machine.local' - )) - ->settings(['mail_driver' => 'log']) - ->build(); - -/* - * Run the actual configuration - */ - -$pipeline->run(); - -echo "Installation complete\n"; +$setup->run(); diff --git a/tests/integration/tmp/public/assets/.gitkeep b/tests/integration/tmp/public/assets/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/integration/tmp/storage/formatter/.gitkeep b/tests/integration/tmp/storage/formatter/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/integration/tmp/storage/sessions/.gitkeep b/tests/integration/tmp/storage/sessions/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/integration/tmp/storage/views/.gitkeep b/tests/integration/tmp/storage/views/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/integration/tmp/vendor/composer/installed.json b/tests/integration/tmp/vendor/composer/installed.json deleted file mode 100644 index 0967ef424..000000000 --- a/tests/integration/tmp/vendor/composer/installed.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/tests/unit/Foundation/ConfigTest.php b/tests/unit/Foundation/ConfigTest.php index e82f2e9e1..7a07ce0e9 100644 --- a/tests/unit/Foundation/ConfigTest.php +++ b/tests/unit/Foundation/ConfigTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Foundation; use Flarum\Foundation\Config; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use InvalidArgumentException; use RuntimeException; diff --git a/tests/unit/Foundation/ContainerUtilTest.php b/tests/unit/Foundation/ContainerUtilTest.php index 3630b204f..1dbe77a57 100644 --- a/tests/unit/Foundation/ContainerUtilTest.php +++ b/tests/unit/Foundation/ContainerUtilTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Foundation; use Flarum\Foundation\ContainerUtil; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use Illuminate\Container\Container; class ContainerUtilTest extends TestCase diff --git a/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php b/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php index b3c3273c2..9d1aa000f 100644 --- a/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php +++ b/tests/unit/Foundation/ErrorHandling/ExceptionHandler/IlluminateValidationExceptionHandlerTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Foundation\ErrorHandling\ExceptionHandler; use Flarum\Foundation\ErrorHandling\ExceptionHandler\IlluminateValidationExceptionHandler; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use Illuminate\Translation\ArrayLoader; use Illuminate\Translation\Translator; use Illuminate\Validation\Factory; diff --git a/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php b/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php index aa8df566f..1b3d97ae1 100644 --- a/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php +++ b/tests/unit/Foundation/ErrorHandling/ExceptionHandler/ValidationExceptionHandlerTest.php @@ -11,7 +11,7 @@ namespace Flarum\Tests\unit\Foundation\ErrorHandling\ExceptionHandler; use Flarum\Foundation\ErrorHandling\ExceptionHandler\ValidationExceptionHandler; use Flarum\Foundation\ValidationException; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; class ValidationExceptionHandlerTest extends TestCase { diff --git a/tests/unit/Foundation/ExtensionDependencyResolutionTest.php b/tests/unit/Foundation/ExtensionDependencyResolutionTest.php index 39fc66ab7..832773978 100644 --- a/tests/unit/Foundation/ExtensionDependencyResolutionTest.php +++ b/tests/unit/Foundation/ExtensionDependencyResolutionTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Foundation; use Flarum\Extension\ExtensionManager; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; class ExtensionDependencyResolutionTest extends TestCase { diff --git a/tests/unit/Foundation/PathsTest.php b/tests/unit/Foundation/PathsTest.php index 7e6faada5..e29b065cf 100644 --- a/tests/unit/Foundation/PathsTest.php +++ b/tests/unit/Foundation/PathsTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Foundation; use Flarum\Foundation\Paths; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use InvalidArgumentException; class PathsTest extends TestCase diff --git a/tests/unit/Foundation/RouteCollectionTest.php b/tests/unit/Foundation/RouteCollectionTest.php index ac6eb26ca..a1699225c 100644 --- a/tests/unit/Foundation/RouteCollectionTest.php +++ b/tests/unit/Foundation/RouteCollectionTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Foundation; use Flarum\Http\RouteCollection; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use RuntimeException; class RouteCollectionTest extends TestCase diff --git a/tests/unit/Http/CookieFactoryTest.php b/tests/unit/Http/CookieFactoryTest.php index 163baf884..c0bab6463 100644 --- a/tests/unit/Http/CookieFactoryTest.php +++ b/tests/unit/Http/CookieFactoryTest.php @@ -12,7 +12,7 @@ namespace Flarum\Tests\unit\Http; use Carbon\Carbon; use Flarum\Foundation\Config; use Flarum\Http\CookieFactory; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; class CookieFactoryTest extends TestCase { diff --git a/tests/unit/Http/RouteCollectionTest.php b/tests/unit/Http/RouteCollectionTest.php index 925b33f4d..968ed9340 100644 --- a/tests/unit/Http/RouteCollectionTest.php +++ b/tests/unit/Http/RouteCollectionTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Http; use Flarum\Http\RouteCollection; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; class RouteCollectionTest extends TestCase { diff --git a/tests/unit/Install/BaseUrlTest.php b/tests/unit/Install/BaseUrlTest.php index 90f24a90f..b9777d2bc 100644 --- a/tests/unit/Install/BaseUrlTest.php +++ b/tests/unit/Install/BaseUrlTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Install; use Flarum\Install\BaseUrl; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use Laminas\Diactoros\Uri; class BaseUrlTest extends TestCase diff --git a/tests/unit/Install/Prerequisite/WritablePathsTest.php b/tests/unit/Install/Prerequisite/WritablePathsTest.php index 93be77bb4..6f8f1d4bb 100644 --- a/tests/unit/Install/Prerequisite/WritablePathsTest.php +++ b/tests/unit/Install/Prerequisite/WritablePathsTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Install\Prerequisite; use Flarum\Install\Prerequisite\WritablePaths; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; class WritablePathsTest extends TestCase { diff --git a/tests/unit/Settings/DatabaseSettingsRepositoryTest.php b/tests/unit/Settings/DatabaseSettingsRepositoryTest.php index 0f3b88d78..75f030d53 100644 --- a/tests/unit/Settings/DatabaseSettingsRepositoryTest.php +++ b/tests/unit/Settings/DatabaseSettingsRepositoryTest.php @@ -10,7 +10,7 @@ namespace Flarum\Tests\unit\Settings; use Flarum\Settings\DatabaseSettingsRepository; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use Illuminate\Database\ConnectionInterface; use Mockery as m; diff --git a/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php b/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php index a7d6f1d09..72d855b40 100644 --- a/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php +++ b/tests/unit/Settings/MemoryCacheSettingsRepositoryTest.php @@ -11,7 +11,7 @@ namespace Flarum\Tests\unit\Settings; use Flarum\Settings\MemoryCacheSettingsRepository; use Flarum\Settings\SettingsRepositoryInterface; -use Flarum\Tests\unit\TestCase; +use Flarum\Testing\unit\TestCase; use Mockery as m; class MemoryCacheSettingsRepositoryTest extends TestCase diff --git a/tests/unit/TestCase.php b/tests/unit/TestCase.php deleted file mode 100644 index 63214ce19..000000000 --- a/tests/unit/TestCase.php +++ /dev/null @@ -1,18 +0,0 @@ -