Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #606

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

Expand Down
12 changes: 8 additions & 4 deletions src/Traits/AuthorizableModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ public function authorizeToAttach(Request $request, $method, $model): bool
: abort(403, "Missing method [$method] in your [$policyClass] policy.");

if ($authorized === false) {
abort(403,
'You cannot attach model:'.get_class($model).', to the model:'.get_class($this->model()).', check your permissions.');
abort(
403,
'You cannot attach model:'.get_class($model).', to the model:'.get_class($this->model()).', check your permissions.'
);
}

return false;
Expand All @@ -131,8 +133,10 @@ public function authorizeToSync(Request $request, $method, Collection $keys): bo
: abort(403, "Missing method [$method] in your [$policyClass] policy.");

if ($authorized === false) {
abort(403,
'You cannot sync key to the model:'.get_class($this->model()).', check your permissions.');
abort(
403,
'You cannot sync key to the model:'.get_class($this->model()).', check your permissions.'
);
}

return false;
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/AuthorizableModelsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ protected function setUp(): void
parent::setUp();

config()->set('restify.cache.policies.enabled', true);
config()->set('cache.default', 'file');

$_SERVER['restify.post.allowRestify'] = true;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/RepositoriesResolvedFromNamespaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function test_repository_can_be_resolved_from_app_namespace(): void
}

#[DataProvider('repositoryPathsFromFixtures')]
public function test_repository_can_be_resolved_from_any_namespace(string $directory, string $namespace): void
public function test_repository_can_be_resolved_from_any_namespace(string $directory, string $namespace, string $serviceProvider): void
{
Restify::repositoriesFrom(
directory: $directory,
Expand Down
Loading