Skip to content

Commit 8ab1f92

Browse files
committed
[Tests] Fix test case setup
1 parent 276be2e commit 8ab1f92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/lib/Acceptance/TestCase.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ protected function setUp(): void
4242

4343
$this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
4444

45+
// @TODO can simplify this when only supporting laravel-json-api/eloquent:^2.0
4546
$this->app->singleton(SchemaContainerContract::class, static function ($container) {
46-
$resolver = new ContainerResolver(static fn() => $container);
47+
if (class_exists(ContainerResolver::class)) {
48+
$resolver = new ContainerResolver(static fn() => $container);
49+
} else {
50+
$resolver = $container;
51+
}
52+
4753
return new SchemaContainer($resolver, $container->make(Server::class), [
4854
PostSchema::class,
4955
]);

0 commit comments

Comments
 (0)