Skip to content

Commit 4537a43

Browse files
committed
[Build] Add support for PHP 8.1
1 parent b7ca447 commit 4537a43

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file. This project adheres to
44
[Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/).
55

6+
## Unreleased
7+
8+
### Added
9+
10+
- Package now supports PHP 8.1.
11+
612
## [1.0.1] - 2021-07-31
713

814
### Fixed

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"require": {
2626
"php": "^7.4|^8.0",
2727
"illuminate/support": "^8.0",
28-
"laravel-json-api/eloquent": "^1.0.0",
28+
"laravel-json-api/eloquent": "^1.0.1|^2.0",
2929
"tenantcloud/laravel-boolean-softdeletes": "^3.1"
3030
},
3131
"require-dev": {
32-
"orchestra/testbench": "^6.17",
33-
"phpunit/phpunit": "^9.5"
32+
"orchestra/testbench": "^6.23",
33+
"phpunit/phpunit": "^9.5.10"
3434
},
3535
"autoload": {
3636
"psr-4": {
@@ -49,7 +49,7 @@
4949
"dev-develop": "1.x-dev"
5050
}
5151
},
52-
"minimum-stability": "stable",
52+
"minimum-stability": "dev",
5353
"prefer-stable": true,
5454
"config": {
5555
"sort-packages": true

phpunit.xml

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
convertErrorsToExceptions="true"
2525
convertNoticesToExceptions="true"
2626
convertWarningsToExceptions="true"
27+
convertDeprecationsToExceptions="true"
2728
processIsolation="false"
2829
stopOnError="false"
2930
stopOnFailure="false"
@@ -47,6 +48,7 @@
4748
</testsuite>
4849
</testsuites>
4950
<php>
51+
<ini name="error_reporting" value="E_ALL"/>
5052
<env name="DB_CONNECTION" value="testing"/>
5153
</php>
5254
</phpunit>

tests/lib/Acceptance/TestCase.php

+10-5
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
namespace LaravelJsonApi\BooleanSoftDeletes\Tests\Acceptance;
2121

2222
use App\Schemas\PostSchema;
23+
use Illuminate\Foundation\Testing\Concerns\InteractsWithDeprecationHandling;
2324
use LaravelJsonApi\Contracts\Schema\Container as SchemaContainerContract;
2425
use LaravelJsonApi\Contracts\Server\Server;
2526
use LaravelJsonApi\Core\Schema\Container as SchemaContainer;
27+
use LaravelJsonApi\Core\Support\ContainerResolver;
2628
use Orchestra\Testbench\TestCase as BaseTestCase;
2729

2830
class TestCase extends BaseTestCase
2931
{
32+
use InteractsWithDeprecationHandling;
3033

3134
/**
3235
* @return void
@@ -35,14 +38,16 @@ protected function setUp(): void
3538
{
3639
parent::setUp();
3740

41+
$this->withoutDeprecationHandling();
42+
3843
$this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
3944

40-
$this->app->singleton(
41-
SchemaContainerContract::class,
42-
fn($container) => new SchemaContainer($container, $container->make(Server::class), [
45+
$this->app->singleton(SchemaContainerContract::class, static function ($container) {
46+
$resolver = new ContainerResolver(static fn() => $container);
47+
return new SchemaContainer($resolver, $container->make(Server::class), [
4348
PostSchema::class,
44-
]),
45-
);
49+
]);
50+
});
4651

4752
$this->app->singleton(Server::class, function () {
4853
$server = $this->createMock(Server::class);

0 commit comments

Comments
 (0)