Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Supports Laravel 12 #1736

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ jobs:
fail-fast: true
matrix:
php: [8.1, 8.2, 8.3, 8.4]
laravel: [10, 11]
exclude:
- php: 8.1
laravel: 11
- php: 8.4
laravel: 10

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
name: PHP ${{ matrix.php }}

steps:
- name: Checkout code
Expand All @@ -39,11 +33,35 @@ jobs:
tools: composer:v2
coverage: none

- name: Install dependencies
- name: Install dependencies (Laravel 10)
run: |
composer update --prefer-dist --no-interaction --no-progress --with="illuminate/contracts=^${{ matrix.laravel }}"
composer update --prefer-dist --no-interaction --no-progress --with="illuminate/contracts:^10"
if: matrix.php >= 8.1 && matrix.php < 8.4

- name: Execute tests
- name: Execute tests (Laravel 10)
run: vendor/bin/phpunit --display-deprecations --fail-on-deprecation
if: matrix.php >= 8.1 && matrix.php < 8.4
env:
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}

- name: Install dependencies (Laravel 11)
run: |
composer update --prefer-dist --no-interaction --no-progress --with="illuminate/contracts:^11"
if: matrix.php >= 8.2 && matrix.php <= 8.4

- name: Execute tests (Laravel 11)
run: vendor/bin/phpunit --display-deprecations --fail-on-deprecation
if: matrix.php >= 8.2 && matrix.php <= 8.4
env:
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}

- name: Install dependencies (Laravel 12)
run: |
composer update --prefer-dist --no-interaction --no-progress --with="illuminate/contracts:^12"
if: matrix.php >= 8.2 && matrix.php <= 8.4

- name: Execute tests (Laravel 12)
run: vendor/bin/phpunit --display-deprecations --fail-on-deprecation
if: matrix.php >= 8.2 && matrix.php <= 8.4
env:
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"require": {
"php": "^8.1",
"ext-json": "*",
"illuminate/console": "^10.0|^11.0",
"illuminate/contracts": "^10.0|^11.0",
"illuminate/database": "^10.0|^11.0",
"illuminate/http": "^10.0|^11.0",
"illuminate/log": "^10.0|^11.0",
"illuminate/notifications": "^10.0|^11.0",
"illuminate/pagination": "^10.0|^11.0",
"illuminate/routing": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"illuminate/view": "^10.0|^11.0",
"illuminate/console": "^10.0|^11.0|^12.0",
"illuminate/contracts": "^10.0|^11.0|^12.0",
"illuminate/database": "^10.0|^11.0|^12.0",
"illuminate/http": "^10.0|^11.0|^12.0",
"illuminate/log": "^10.0|^11.0|^12.0",
"illuminate/notifications": "^10.0|^11.0|^12.0",
"illuminate/pagination": "^10.0|^11.0|^12.0",
"illuminate/routing": "^10.0|^11.0|^12.0",
"illuminate/support": "^10.0|^11.0|^12.0",
"illuminate/view": "^10.0|^11.0|^12.0",
"moneyphp/money": "^4.0",
"nesbot/carbon": "^2.0|^3.0",
"stripe/stripe-php": "^16.2",
Expand All @@ -40,9 +40,9 @@
"require-dev": {
"dompdf/dompdf": "^2.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^8.18|^9.0",
"orchestra/testbench": "^8.18|^9.0|^10.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4"
"phpunit/phpunit": "^10.4|^11.5"
},
"suggest": {
"ext-intl": "Allows for more locales besides the default \"en\" when formatting money values.",
Expand Down
6 changes: 5 additions & 1 deletion tests/Feature/FeatureTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
use Laravel\Cashier\Cashier;
use Laravel\Cashier\Tests\Fixtures\User;
use Laravel\Cashier\Tests\TestCase;
use Orchestra\Testbench\Attributes\RequiresEnv;
use Orchestra\Testbench\Concerns\WithLaravelMigrations;
use Stripe\ApiRequestor as StripeApiRequestor;
use Stripe\HttpClient\CurlClient as StripeCurlClient;
use Stripe\StripeClient;

#[RequiresEnv('STRIPE_SECRET')]
#[WithMigration]
abstract class FeatureTestCase extends TestCase
{
use RefreshDatabase, WithLaravelMigrations;
use RefreshDatabase;
use WithLaravelMigrations;

protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class TestCase extends OrchestraTestCase
{
use WithWorkbench;

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$apiKey = config('cashier.secret');

Expand Down
Loading