diff --git a/migrations/create_table_comments_1698145440.php b/migrations/create_table_comments_1698145440.php index dad02ed..46b00ae 100644 --- a/migrations/create_table_comments_1698145440.php +++ b/migrations/create_table_comments_1698145440.php @@ -1,9 +1,9 @@ getConfigs()['driver']) { + switch (db()->getConfigs()['driver']) { case 'mysql': $this->runCommandInternally(self::COMMANDS['migrate'], ['direction' => 'down']); $this->runCommandInternally(self::COMMANDS['migrate'], ['direction' => 'up']); @@ -449,7 +425,6 @@ private function removeUploads(): void /** * Cleans the uploads and resets the database. - * @return void * @throws BaseException * @throws ConfigException * @throws DiException @@ -463,8 +438,6 @@ private function resetDatabase(): void } /** - * @param string $commandName - * @param array $arguments * @throws ExceptionInterface */ private function runCommandInternally(string $commandName, array $arguments = []): void @@ -474,8 +447,7 @@ private function runCommandInternally(string $commandName, array $arguments = [] } /** - * @param string $commandName - * @param array $arguments + * Runs command externally */ private function runCommandExternally(string $commandName, array $arguments = []): void { @@ -485,8 +457,6 @@ private function runCommandExternally(string $commandName, array $arguments = [] /** * Runs separate process - * @param array $command - * @return void */ private function runExternalProcess(array $command): void { @@ -498,8 +468,6 @@ private function runExternalProcess(array $command): void /** * Builds command string - * @param string $commandName - * @param array $arguments * @return string[] */ private function buildCommand(string $commandName, array $arguments): array diff --git a/shared/Commands/PostCreateCommand.php b/shared/Commands/PostCreateCommand.php index 9192461..efbcecd 100644 --- a/shared/Commands/PostCreateCommand.php +++ b/shared/Commands/PostCreateCommand.php @@ -20,7 +20,7 @@ use Quantum\App\Exceptions\BaseException; use Quantum\Di\Exceptions\DiException; use Shared\Services\PostService; -use Quantum\Console\QtCommand; +use Quantum\Console\CliCommand; use Quantum\Validation\Rule; use Shared\DTOs\PostDTO; use ReflectionException; @@ -29,7 +29,7 @@ * Class PostCreateCommand * @package Shared\Commands */ -class PostCreateCommand extends QtCommand +class PostCreateCommand extends CliCommand { use CommandValidationTrait; diff --git a/shared/Commands/PostDeleteCommand.php b/shared/Commands/PostDeleteCommand.php index 0db76d3..51d4a03 100644 --- a/shared/Commands/PostDeleteCommand.php +++ b/shared/Commands/PostDeleteCommand.php @@ -20,14 +20,14 @@ use Quantum\App\Exceptions\BaseException; use Quantum\Di\Exceptions\DiException; use Shared\Services\PostService; -use Quantum\Console\QtCommand; +use Quantum\Console\CliCommand; use ReflectionException; /** * Class PostDeleteCommand * @package Shared\Commands */ -class PostDeleteCommand extends QtCommand +class PostDeleteCommand extends CliCommand { /** * Command name diff --git a/shared/Commands/PostShowCommand.php b/shared/Commands/PostShowCommand.php index b4b7c74..c1c2ede 100644 --- a/shared/Commands/PostShowCommand.php +++ b/shared/Commands/PostShowCommand.php @@ -22,14 +22,14 @@ use Quantum\Di\Exceptions\DiException; use Quantum\Model\ModelCollection; use Shared\Services\PostService; -use Quantum\Console\QtCommand; +use Quantum\Console\CliCommand; use ReflectionException; /** * Class PostShowCommand * @package Shared\Commands */ -class PostShowCommand extends QtCommand +class PostShowCommand extends CliCommand { /** * Posts per page diff --git a/shared/Commands/PostUpdateCommand.php b/shared/Commands/PostUpdateCommand.php index 8fdffeb..a1e6897 100644 --- a/shared/Commands/PostUpdateCommand.php +++ b/shared/Commands/PostUpdateCommand.php @@ -20,7 +20,7 @@ use Quantum\App\Exceptions\BaseException; use Quantum\Di\Exceptions\DiException; use Shared\Services\PostService; -use Quantum\Console\QtCommand; +use Quantum\Console\CliCommand; use Quantum\Validation\Rule; use Shared\DTOs\PostDTO; use ReflectionException; @@ -29,7 +29,7 @@ * Class PostUpdateCommand * @package Shared\Commands */ -class PostUpdateCommand extends QtCommand +class PostUpdateCommand extends CliCommand { use CommandValidationTrait; diff --git a/shared/Commands/UserCreateCommand.php b/shared/Commands/UserCreateCommand.php index 41c4e85..529bfde 100644 --- a/shared/Commands/UserCreateCommand.php +++ b/shared/Commands/UserCreateCommand.php @@ -21,7 +21,7 @@ use Quantum\Di\Exceptions\DiException; use Quantum\Validation\Validator; use Shared\Services\AuthService; -use Quantum\Console\QtCommand; +use Quantum\Console\CliCommand; use Quantum\Validation\Rule; use Quantum\Hasher\Hasher; use Shared\DTOs\UserDTO; @@ -32,7 +32,7 @@ * Class UserCreateCommand * @package Shared\Commands */ -class UserCreateCommand extends QtCommand +class UserCreateCommand extends CliCommand { use CommandValidationTrait; diff --git a/shared/Commands/UserDeleteCommand.php b/shared/Commands/UserDeleteCommand.php index d9336f0..93afd90 100644 --- a/shared/Commands/UserDeleteCommand.php +++ b/shared/Commands/UserDeleteCommand.php @@ -20,14 +20,14 @@ use Quantum\App\Exceptions\BaseException; use Quantum\Di\Exceptions\DiException; use Shared\Services\AuthService; -use Quantum\Console\QtCommand; +use Quantum\Console\CliCommand; use ReflectionException; /** * Class PostDeleteCommand * @package Shared\Commands */ -class UserDeleteCommand extends QtCommand +class UserDeleteCommand extends CliCommand { /** * Command name diff --git a/shared/Commands/UserShowCommand.php b/shared/Commands/UserShowCommand.php index 72e01d4..21ff1ed 100644 --- a/shared/Commands/UserShowCommand.php +++ b/shared/Commands/UserShowCommand.php @@ -22,14 +22,14 @@ use Quantum\Di\Exceptions\DiException; use Quantum\Model\ModelCollection; use Shared\Services\AuthService; -use Quantum\Console\QtCommand; +use Quantum\Console\CliCommand; use ReflectionException; /** * Class UserShowCommand * @package Shared\Commands */ -class UserShowCommand extends QtCommand +class UserShowCommand extends CliCommand { /** * Command name diff --git a/shared/Services/AuthService.php b/shared/Services/AuthService.php index cc5d9a0..b61b509 100644 --- a/shared/Services/AuthService.php +++ b/shared/Services/AuthService.php @@ -23,7 +23,7 @@ use Quantum\Di\Exceptions\DiException; use Quantum\Auth\User as AuthUser; use Quantum\Model\ModelCollection; -use Quantum\Service\QtService; +use Quantum\Service\Service; use ReflectionException; use Shared\Models\User; @@ -31,7 +31,7 @@ * Class AuthService * @package Shared\Services */ -class AuthService extends QtService implements AuthServiceInterface +class AuthService extends Service implements AuthServiceInterface { /** * @var User diff --git a/shared/Services/CommentService.php b/shared/Services/CommentService.php index 0aaffc3..89067b1 100644 --- a/shared/Services/CommentService.php +++ b/shared/Services/CommentService.php @@ -20,7 +20,7 @@ use Shared\Transformers\CommentTransformer; use Quantum\App\Exceptions\BaseException; use Quantum\Model\ModelCollection; -use Quantum\Service\QtService; +use Quantum\Service\Service; use Shared\DTOs\CommentDTO; use Shared\Models\Comment; use Shared\Models\User; @@ -29,7 +29,7 @@ * Class CommentService * @package Shared\Services */ -class CommentService extends QtService +class CommentService extends Service { /** * @var Comment diff --git a/shared/Services/PostService.php b/shared/Services/PostService.php index 9ec6375..d2d331b 100644 --- a/shared/Services/PostService.php +++ b/shared/Services/PostService.php @@ -28,7 +28,7 @@ use Quantum\Model\ModelCollection; use Quantum\Storage\UploadedFile; use Gumlet\ImageResizeException; -use Quantum\Service\QtService; +use Quantum\Service\Service; use Quantum\Model\DbModel; use ReflectionException; use Shared\DTOs\PostDTO; @@ -39,7 +39,7 @@ * Class PostService * @package Shared\Services */ -class PostService extends QtService +class PostService extends Service { /** * @var DbModel diff --git a/tests/Feature/AppTestCase.php b/tests/Feature/AppTestCase.php index 37c2e76..2285e1e 100644 --- a/tests/Feature/AppTestCase.php +++ b/tests/Feature/AppTestCase.php @@ -40,7 +40,6 @@ public function request( array $headers = [], array $files = [] ): Response { - self::$app = createApp(AppType::WEB, PROJECT_ROOT); request()->create($method, $url, $params, $headers, $files); self::$app->start(); return response(); diff --git a/tests/Feature/modules/Api/AuthControllerTest.php b/tests/Feature/modules/Api/AuthControllerTest.php index 2d08afd..a6a632b 100644 --- a/tests/Feature/modules/Api/AuthControllerTest.php +++ b/tests/Feature/modules/Api/AuthControllerTest.php @@ -15,8 +15,6 @@ class AuthControllerTest extends AppTestCase public function setUp(): void { parent::setUp(); - - request()->flush(); response()->flush(); $this->faker = Factory::create(); diff --git a/tests/Feature/modules/Api/CommentControllerTest.php b/tests/Feature/modules/Api/CommentControllerTest.php index a6f906c..cb9529f 100644 --- a/tests/Feature/modules/Api/CommentControllerTest.php +++ b/tests/Feature/modules/Api/CommentControllerTest.php @@ -23,8 +23,6 @@ public function setUp(): void $postData = $response->get('data'); $this->post = $postData[0]; - - request()->flush(); response()->flush(); } diff --git a/tests/Feature/modules/Api/PostControllerTest.php b/tests/Feature/modules/Api/PostControllerTest.php index 59232dc..fd9d7a8 100644 --- a/tests/Feature/modules/Api/PostControllerTest.php +++ b/tests/Feature/modules/Api/PostControllerTest.php @@ -11,8 +11,6 @@ class PostControllerTest extends AppTestCase public function setUp(): void { parent::setUp(); - - request()->flush(); } public function tearDown(): void diff --git a/tests/Feature/modules/Api/PostManagementControllerTest.php b/tests/Feature/modules/Api/PostManagementControllerTest.php index 4af5df6..b06b080 100644 --- a/tests/Feature/modules/Api/PostManagementControllerTest.php +++ b/tests/Feature/modules/Api/PostManagementControllerTest.php @@ -15,8 +15,6 @@ public function setUp(): void parent::setUp(); $this->tokens = $this->signInAndGetTokens(); - - request()->flush(); } public function tearDown(): void diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 14705b8..35e2172 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -29,7 +29,7 @@ createPostComments($user, $posts); register_shutdown_function(function () { - removeEnvFile(); - removeModule(); dbCleanUp(); + removeModule(); + removeEnvFile(); });