diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4784676dd..eab36bad1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,17 +13,24 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4] - laravel: [^7.0, ^8.0] - - name: P${{ matrix.php }} - L${{ matrix.laravel }} + os: [ubuntu-latest] + php: [8.0, 7.4] + laravel: [^8.0, ^7.0] + dependency-version: [prefer-stable] + include: + - laravel: ^8.0 + testbench: ^6.0 + - laravel: ^7.0 + testbench: ^5.2 + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v2 - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} @@ -31,12 +38,14 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip - coverage: none + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none - name: Install dependencies - run: composer require "illuminate/contracts=${{ matrix.laravel }}" --prefer-dist --no-interaction --no-suggest + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest - name: Execute tests run: vendor/bin/phpunit --verbose diff --git a/composer.json b/composer.json index a2f10df2d..66de18061 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": "^7.4", + "php": "^7.4|^8.0", "ext-json": "*", "doctrine/dbal": "^2.10", "illuminate/support": "^7.0|^8.0", diff --git a/tests/Controllers/RepositoryIndexControllerTest.php b/tests/Controllers/RepositoryIndexControllerTest.php index 705aee725..a1f50d4a5 100644 --- a/tests/Controllers/RepositoryIndexControllerTest.php +++ b/tests/Controllers/RepositoryIndexControllerTest.php @@ -139,7 +139,6 @@ public function test_repository_with_nested_relations() }); $response = $this->getJson(CompanyRepository::uriKey().'?related=users.posts') - ->dump() ->assertOk(); $this->assertCount(1, $response->json('data.0.relationships.users')); diff --git a/tests/Fields/FileTest.php b/tests/Fields/FileTest.php index 2f8724814..065331791 100644 --- a/tests/Fields/FileTest.php +++ b/tests/Fields/FileTest.php @@ -94,7 +94,6 @@ public function test_can_prune_prunable_files() ]); $this->delete(UserRepository::uriKey()."/{$user->id}") - ->dump() ->assertNoContent(); Storage::disk('customDisk')->assertMissing('avatar.jpg'); diff --git a/tests/Fixtures/Post/PostPolicy.php b/tests/Fixtures/Post/PostPolicy.php index c10756e9a..39ab0d187 100644 --- a/tests/Fixtures/Post/PostPolicy.php +++ b/tests/Fixtures/Post/PostPolicy.php @@ -51,7 +51,7 @@ public function delete($user, $post) return $_SERVER['restify.post.delete'] ?? true; } - public function attachUser($user = null, Post $post, User $userToAttach) + public function attachUser(object $user = null, $post, $userToAttach) { return $_SERVER['restify.post.allowAttachUser'] ?? true; }