Skip to content

Commit

Permalink
db test passes
Browse files Browse the repository at this point in the history
  • Loading branch information
bezhanSalleh committed Nov 8, 2024
1 parent 51ea8fb commit cad9fb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"pest_2.36.0","defects":[],"times":{"P\\Tests\\DatabaseTest::__pest_evaluable_it_can_check_if_the_permission_name_can_be_configured_using_the_closure":0.008,"P\\Tests\\DatabaseTest::__pest_evaluable_it_can_check_if_package_testing_is_configured":0}}
{"version":"pest_2.36.0","defects":[],"times":{"P\\Tests\\DatabaseTest::__pest_evaluable_it_can_check_if_the_permission_name_can_be_configured_using_the_closure":0.005,"P\\Tests\\DatabaseTest::__pest_evaluable_it_can_check_if_package_testing_is_configured":0}}
8 changes: 2 additions & 6 deletions tests/DatabaseTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Spatie\Permission\PermissionRegistrar;
use BezhanSalleh\FilamentShield\Facades\FilamentShield;
use BezhanSalleh\FilamentShield\Resources\RoleResource;

Expand All @@ -10,13 +11,8 @@
it('can check if the permission name can be configured using the closure', function () {
$resource = RoleResource::class;

// FilamentShield::configurePermissionIdentifierUsing(fn () => str($resource)->afterLast('Resources\\')->replace('\\', '')->headline()->snake()->replace('_', '.'));
// expect(FilamentShield::getPermissionIdentifier($resource))->toBe('role.resource');
// FilamentShield::configurePermissionIdentifierUsing(fn () => str($resource)->afterLast('Resources\\')->replace('\\', '')->headline()->snake()->replace('_', '::'));
// expect(FilamentShield::getPermissionIdentifier($resource))->toBe('role::resource');

FilamentShield::configurePermissionIdentifierUsing(
fn ($resource) => str($resource::getModel())
fn ($resource) => str('Spatie\\Permission\\Models\\Role')
->afterLast('\\')
->lower()
->toString()
Expand Down

0 comments on commit cad9fb5

Please sign in to comment.