From 97141857af377430696d9413f4d190550fa98f1c Mon Sep 17 00:00:00 2001 From: Ricardo Gobbo de Souza Date: Fri, 26 Apr 2024 10:29:06 -0300 Subject: [PATCH] Add support Laravel 11 --- .github/workflows/tests.yml | 26 +++++++++++++++++--------- composer.json | 12 +++++------- tests/TestCase.php | 10 +--------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c868886..4c5c839 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,26 +10,32 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [7.4, 8.0, 8.1] - laravel: [^8.0, ^9.0, ^10.0] + php: [7.4, 8.0, 8.1, 8.2] + laravel: [^8.0, ^9.0, ^10.0, ^11.0] #stability: [prefer-lowest, prefer-stable] stability: [prefer-stable] exclude: - php: 7.4 - laravel: 9 + laravel: ^9.0 - php: 7.4 - laravel: 10 + laravel: ^10.0 + - php: 7.4 + laravel: ^11.0 + - php: 8.0 + laravel: ^10.0 - php: 8.0 - laravel: 10 + laravel: ^11.0 + - php: 8.1 + laravel: ^11.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} @@ -45,7 +51,9 @@ jobs: run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest - name: Execute tests - run: vendor/bin/phpunit --verbose + run: vendor/bin/phpunit - name: Coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/composer.json b/composer.json index a8936e0..6c0de9f 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,13 @@ ], "require": { "php": "^7.4|^8.0", - "illuminate/database": "^8.0|^9.0|^10.0", - "illuminate/support": "^8.0|^9.0|^10.0" + "illuminate/database": "^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0" }, "require-dev": { - "graham-campbell/testbench": "^6.0", + "graham-campbell/testbench": "^6.1", "mockery/mockery": "^1.6", - "phpunit/phpunit": "^9.5|^10.0", - "spatie/phpunit-watcher": "^1.23" + "phpunit/phpunit": "^9.5|^10.5" }, "autoload": { "psr-4": { @@ -39,8 +38,7 @@ } }, "scripts": { - "test": "vendor/bin/phpunit", - "watch": "vendor/bin/phpunit-watcher watch" + "test": "vendor/bin/phpunit" }, "extra": { "laravel": { diff --git a/tests/TestCase.php b/tests/TestCase.php index c01ff55..c6df999 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -10,19 +10,11 @@ abstract class TestCase extends AbstractPackageTestCase { use RefreshDatabase; - /** - * Setup the test environment. - */ - protected function setUp(): void + protected function defineDatabaseMigrations(): void { - parent::setUp(); - $this->loadMigrationsFrom(__DIR__.'/Database/Migrations'); } - /** - * Get the service provider class. - */ protected static function getServiceProviderClass(): string { return BuilderMacroServiceProvider::class;