Skip to content

Commit

Permalink
fix tests running in parallel with include_once
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Dec 14, 2023
1 parent c51e220 commit 828bf96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Http/ApplyFiltersToQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Illuminate\Support\Traits\ForwardsCalls;
use OpenSoutheners\LaravelApiable\Contracts\HandlesRequestQueries;
use OpenSoutheners\LaravelApiable\Support\Apiable;

use function OpenSoutheners\LaravelHelpers\Classes\class_namespace;

class ApplyFiltersToQuery implements HandlesRequestQueries
Expand All @@ -24,8 +25,7 @@ class ApplyFiltersToQuery implements HandlesRequestQueries
/**
* Apply modifications to the query based on allowed query fragments.
*
* @param \OpenSoutheners\LaravelApiable\Http\RequestQueryObject $request
* @param \Closure(\OpenSoutheners\LaravelApiable\Http\RequestQueryObject): \Illuminate\Database\Eloquent\Builder $next
* @param \Closure(\OpenSoutheners\LaravelApiable\Http\RequestQueryObject): \Illuminate\Database\Eloquent\Builder $next
* @return \Illuminate\Database\Eloquent\Builder
*/
public function from(RequestQueryObject $request, Closure $next)
Expand Down Expand Up @@ -146,7 +146,7 @@ protected function applyFilterAsWhere($query, $relationship, string $attribute,
*
* @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $query
*/
protected function applyFilterAsScope($query, string|null $relationship, string $scope, string $operator, string $value, string $condition): void
protected function applyFilterAsScope($query, $relationship, string $scope, string $operator, string $value, string $condition): void
{
$wrappedQueryFn = fn ($query) => $this->forwardCallTo($query, $scope, (array) $value);

Expand Down
6 changes: 2 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ abstract class TestCase extends Orchestra
{
/**
* Setup the test environment.
*
* @return void
*/
protected function setUp(): void
{
parent::setUp();

$this->withoutExceptionHandling();
}

Expand Down Expand Up @@ -55,7 +53,7 @@ protected function defineEnvironment($app)
]);

// Setup package own config (statuses)
$app['config']->set('apiable', include_once __DIR__.'/../config/apiable.php');
$app['config']->set('apiable', include __DIR__.'/../config/apiable.php');
$app['config']->set('apiable.resource_type_map', [
Plan::class => 'plan',
Post::class => 'post',
Expand Down

0 comments on commit 828bf96

Please sign in to comment.