diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eebdc3ee..965757ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,16 +21,23 @@ jobs: laravel: - '7.0' - '8.22' + - '9.0' exclude: - php: '7.2' laravel: '8.22' + - php: '7.2' + laravel: '9.0' + - php: '7.3' + laravel: '9.0' + - php: '7.4' + laravel: '9.0' - php: '8.0' laravel: '7.0' - php: '8.0' - laravel: '8.22' + laravel: '9.0' include: - php: '8.0' - laravel: '8.22' + laravel: '9.0' analysis: true coverage: 'xdebug' normalize: true @@ -54,7 +61,7 @@ jobs: run: composer validate --strict - name: Install Laravel legacy factories support - if: matrix.laravel == '8.22' + if: matrix.laravel != '7.0' run: composer require "laravel/legacy-factories:^1.1" --dev --no-interaction --no-update - name: Install Laravel and Orchestra Testbench diff --git a/composer.json b/composer.json index 660df275..d8b6f83d 100644 --- a/composer.json +++ b/composer.json @@ -28,15 +28,15 @@ "ext-json": "*", "funeralzone/valueobjects": "^0.5", "jenssegers/agent": "^2.6", - "laravel/framework": "^7.0 || ^8.0", + "laravel/framework": "^7.0 || ^8.0 || ^9.0", "osiset/basic-shopify-api": "^9.0 || ^10.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.8", "friendsofphp/php-cs-fixer": "^3.0", "mockery/mockery": "^1.0", - "orchestra/database": "~3.8 || ~4.0 || ~5.0 || ~6.0", - "orchestra/testbench": "~3.8 || ~4.0 || ~5.0 || ~6.0", + "orchestra/database": "~3.8 || ~4.0 || ~5.0 || ~6.0 || ~7.0", + "orchestra/testbench": "~3.8 || ~4.0 || ~5.0 || ~6.0 || ~7.0", "phpstan/phpstan": "^0.12", "phpunit/phpunit": "~8.0 || ^9.0" }, diff --git a/src/Traits/BillingController.php b/src/Traits/BillingController.php index 1d24742d..6cae42de 100644 --- a/src/Traits/BillingController.php +++ b/src/Traits/BillingController.php @@ -27,18 +27,18 @@ trait BillingController /** * Redirects to billing screen for Shopify. * - * @param int|null $plan The plan's ID, if provided in route. * @param Request $request The request object. * @param ShopQuery $shopQuery The shop querier. * @param GetPlanUrl $getPlanUrl The action for getting the plan URL. + * @param int|null $plan The plan's ID, if provided in route. * * @return ViewView */ public function index( - ?int $plan = null, Request $request, ShopQuery $shopQuery, - GetPlanUrl $getPlanUrl + GetPlanUrl $getPlanUrl, + ?int $plan = null ): ViewView { // Get the shop $shop = $shopQuery->getByDomain(ShopDomain::fromNative($request->get('shop'))); diff --git a/tests/Stubs/Kernel.php b/tests/Stubs/Kernel.php index 15eb36d8..ccdd1328 100644 --- a/tests/Stubs/Kernel.php +++ b/tests/Stubs/Kernel.php @@ -13,7 +13,7 @@ use Osiset\ShopifyApp\Http\Middleware\Billable; use Osiset\ShopifyApp\Http\Middleware\VerifyShopify; -class Kernel extends \Orchestra\Testbench\Http\Kernel +class Kernel extends \Orchestra\Testbench\Foundation\Http\Kernel { /** * The application's route middleware. @@ -36,4 +36,26 @@ class Kernel extends \Orchestra\Testbench\Http\Kernel 'auth.proxy' => AuthProxy::class, 'billable' => Billable::class, ]; + + /** + * The application's route middleware groups. + * + * @var array + */ + protected $middlewareGroups = [ + 'web' => [ + \Illuminate\Cookie\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + // \Illuminate\Session\Middleware\AuthenticateSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + + 'api' => [ + 'throttle:api', + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + ]; }