Skip to content

Commit 87ac7a2

Browse files
Allow PHP 8.0 (#349)
* Update filtering.md * Allow PHP 8.0 * Test against PHP 8.0 * Fix tests
1 parent 78ec5bb commit 87ac7a2

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

.github/workflows/tests.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,39 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [7.4]
17-
laravel: [^7.0, ^8.0]
18-
19-
name: P${{ matrix.php }} - L${{ matrix.laravel }}
16+
os: [ubuntu-latest]
17+
php: [8.0, 7.4]
18+
laravel: [^8.0, ^7.0]
19+
dependency-version: [prefer-stable]
20+
include:
21+
- laravel: ^8.0
22+
testbench: ^6.0
23+
- laravel: ^7.0
24+
testbench: ^5.2
25+
26+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
2027

2128
steps:
2229
- name: Checkout code
2330
uses: actions/checkout@v2
2431

2532
- name: Cache dependencies
26-
uses: actions/cache@v1
33+
uses: actions/cache@v2
2734
with:
2835
path: ~/.composer/cache/files
2936
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
3037

3138
- name: Setup PHP
3239
uses: shivammathur/setup-php@v2
3340
with:
34-
php-version: ${{ matrix.php }}
35-
extensions: dom, curl, libxml, mbstring, zip
36-
coverage: none
41+
php-version: ${{ matrix.php }}
42+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
43+
coverage: none
3744

3845
- name: Install dependencies
39-
run: composer require "illuminate/contracts=${{ matrix.laravel }}" --prefer-dist --no-interaction --no-suggest
46+
run: |
47+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
48+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
4049
4150
- name: Execute tests
4251
run: vendor/bin/phpunit --verbose

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
],
2020
"require": {
21-
"php": "^7.4",
21+
"php": "^7.4|^8.0",
2222
"ext-json": "*",
2323
"doctrine/dbal": "^2.10",
2424
"illuminate/support": "^7.0|^8.0",

tests/Controllers/RepositoryIndexControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ public function test_repository_with_nested_relations()
139139
});
140140

141141
$response = $this->getJson(CompanyRepository::uriKey().'?related=users.posts')
142-
->dump()
143142
->assertOk();
144143

145144
$this->assertCount(1, $response->json('data.0.relationships.users'));

tests/Fields/FileTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function test_can_prune_prunable_files()
9494
]);
9595

9696
$this->delete(UserRepository::uriKey()."/{$user->id}")
97-
->dump()
9897
->assertNoContent();
9998

10099
Storage::disk('customDisk')->assertMissing('avatar.jpg');

tests/Fixtures/Post/PostPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function delete($user, $post)
5151
return $_SERVER['restify.post.delete'] ?? true;
5252
}
5353

54-
public function attachUser($user = null, Post $post, User $userToAttach)
54+
public function attachUser(object $user = null, $post, $userToAttach)
5555
{
5656
return $_SERVER['restify.post.allowAttachUser'] ?? true;
5757
}

0 commit comments

Comments
 (0)