From d37520ba51ec70f678171e74dc6ab9f386987b4a Mon Sep 17 00:00:00 2001 From: dpankratov Date: Wed, 2 Jul 2025 10:09:20 +0600 Subject: [PATCH] feat: use new Laravel helpers version --- app/Enums/VersionEnum.php | 8 +- composer.lock | 378 ++++++++++++++++++++++---------------- tests/TestCase.php | 9 +- 3 files changed, 227 insertions(+), 168 deletions(-) diff --git a/app/Enums/VersionEnum.php b/app/Enums/VersionEnum.php index f6c72fb..a12b58f 100644 --- a/app/Enums/VersionEnum.php +++ b/app/Enums/VersionEnum.php @@ -2,11 +2,17 @@ namespace App\Enums; +use RonasIT\Support\Contracts\VersionEnumContract; use RonasIT\Support\Traits\EnumTrait; -enum VersionEnum: string +enum VersionEnum: string implements VersionEnumContract { use EnumTrait; case v0_1 = '0.1'; + + public static function last(): VersionEnum + { + return self::v0_1; + } } diff --git a/composer.lock b/composer.lock index bef0905..5a81b52 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e20a6c43da9f5cc3b1f9aa19e9482a0b", + "content-hash": "843d293f052ea09bac864fa29f7c45d7", "packages": [ { "name": "brick/math", @@ -370,6 +370,157 @@ }, "time": "2024-07-08T12:26:09+00:00" }, + { + "name": "doctrine/dbal", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/33d2d7fe1269b2301640c44cf2896ea607b30e3e", + "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3|^1", + "php": "^8.1", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.2", + "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-phpunit": "2.0.3", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "10.5.39", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.10.2", + "symfony/cache": "^6.3.8|^7.0", + "symfony/console": "^5.4|^6.3|^7.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/4.2.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2025-03-07T18:29:05+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/log": "^1 || ^2 || ^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" + }, + "time": "2024-12-07T21:18:45+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.10", @@ -5848,6 +5999,62 @@ ], "time": "2024-04-27T21:32:50+00:00" }, + { + "name": "riverline/multipart-parser", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/Riverline/multipart-parser.git", + "reference": "1410f23a8fd416a0cf5c8867ea9c95544016c831" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Riverline/multipart-parser/zipball/1410f23a8fd416a0cf5c8867ea9c95544016c831", + "reference": "1410f23a8fd416a0cf5c8867ea9c95544016c831", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "laminas/laminas-diactoros": "^1.8.7 || ^2.11.1", + "phpunit/phpunit": "^5.7 || ^9.0", + "psr/http-message": "^1.0", + "symfony/psr-http-message-bridge": "^1.1 || ^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Riverline\\MultiPartParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Romain Cambien", + "email": "romain@cambien.net" + }, + { + "name": "Riverline", + "homepage": "http://www.riverline.fr" + } + ], + "description": "One class library to parse multipart content with encoding and charset support.", + "keywords": [ + "http", + "multipart", + "parser" + ], + "support": { + "issues": "https://github.com/Riverline/multipart-parser/issues", + "source": "https://github.com/Riverline/multipart-parser/tree/2.2.0" + }, + "time": "2025-04-29T08:38:14+00:00" + }, { "name": "rize/uri-template", "version": "0.4.0", @@ -5914,25 +6121,27 @@ }, { "name": "ronasit/laravel-helpers", - "version": "3.3.1", + "version": "3.4.5", "source": { "type": "git", "url": "https://github.com/RonasIT/laravel-helpers.git", - "reference": "581b1a338c1b1e375f11148ec93323f786406548" + "reference": "d680d000497286a7b8de0d197cecd8baf16fb8d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/RonasIT/laravel-helpers/zipball/581b1a338c1b1e375f11148ec93323f786406548", - "reference": "581b1a338c1b1e375f11148ec93323f786406548", + "url": "https://api.github.com/repos/RonasIT/laravel-helpers/zipball/d680d000497286a7b8de0d197cecd8baf16fb8d4", + "reference": "d680d000497286a7b8de0d197cecd8baf16fb8d4", "shasum": "" }, "require": { + "doctrine/dbal": "^4.2", "ext-json": "*", "guzzlehttp/guzzle": "^7.9.2", "laravel/framework": ">=11.20", "maatwebsite/excel": "^3.1.55", "php": ">=8.3", - "php-mock/php-mock-phpunit": "^2.10" + "php-mock/php-mock-phpunit": "^2.10", + "riverline/multipart-parser": "^2.1" }, "require-dev": { "brainmaestro/composer-git-hooks": "^3.0", @@ -5987,9 +6196,9 @@ ], "support": { "issues": "https://github.com/RonasIT/laravel-helpers/issues", - "source": "https://github.com/RonasIT/laravel-helpers/tree/3.3.1" + "source": "https://github.com/RonasIT/laravel-helpers/tree/3.4.5" }, - "time": "2025-03-18T16:24:43+00:00" + "time": "2025-06-23T08:22:31+00:00" }, { "name": "ronasit/laravel-swagger", @@ -10709,157 +10918,6 @@ ], "time": "2025-03-24T13:50:44+00:00" }, - { - "name": "doctrine/dbal", - "version": "4.2.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/33d2d7fe1269b2301640c44cf2896ea607b30e3e", - "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^0.5.3|^1", - "php": "^8.1", - "psr/cache": "^1|^2|^3", - "psr/log": "^1|^2|^3" - }, - "require-dev": { - "doctrine/coding-standard": "12.0.0", - "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2023.2", - "phpstan/phpstan": "2.1.1", - "phpstan/phpstan-phpunit": "2.0.3", - "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "10.5.39", - "slevomat/coding-standard": "8.13.1", - "squizlabs/php_codesniffer": "3.10.2", - "symfony/cache": "^6.3.8|^7.0", - "symfony/console": "^5.4|^6.3|^7.0" - }, - "suggest": { - "symfony/console": "For helpful console commands such as SQL execution and import of files." - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\DBAL\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - } - ], - "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", - "homepage": "https://www.doctrine-project.org/projects/dbal.html", - "keywords": [ - "abstraction", - "database", - "db2", - "dbal", - "mariadb", - "mssql", - "mysql", - "oci8", - "oracle", - "pdo", - "pgsql", - "postgresql", - "queryobject", - "sasql", - "sql", - "sqlite", - "sqlserver", - "sqlsrv" - ], - "support": { - "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/4.2.3" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", - "type": "tidelift" - } - ], - "time": "2025-03-07T18:29:05+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "1.4.10 || 2.0.3", - "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psr/log": "^1 || ^2 || ^3" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.4" - }, - "time": "2024-12-07T21:18:45+00:00" - }, { "name": "fakerphp/faker", "version": "v1.24.1", @@ -11618,7 +11676,7 @@ ], "aliases": [], "minimum-stability": "beta", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/tests/TestCase.php b/tests/TestCase.php index c943bdc..51c9f95 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -23,6 +23,8 @@ public function setUp(): void { parent::setUp(); + $this->setAPIVersion(VersionEnum::last()); + $defaultGuard = config('auth.defaults.guard'); self::$isJwtGuard = config("auth.guards.{$defaultGuard}.driver") === 'jwt'; @@ -64,11 +66,4 @@ public function call($method, $uri, $parameters = [], $cookies = [], $files = [] return parent::call($method, $uri, $parameters, $cookies, $files, $server, $content); } - - public function json($method, $uri, array $data = [], array $headers = [], $options = 0, ?VersionEnum $apiVersion = null): TestResponse - { - $apiVersion = (empty($apiVersion)) ? last(VersionEnum::values()) : $apiVersion->value; - - return parent::json($method, "/v{$apiVersion}{$uri}", $data, $headers); - } }