Skip to content

Commit

Permalink
Replaced referencs to Laminas\Permission
Browse files Browse the repository at this point in the history
  • Loading branch information
visto9259 committed Aug 16, 2024
1 parent 805f356 commit cadeced
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/Role/RoleProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

namespace LmcRbacMvc\Role;

use Laminas\Permissions\Rbac\RoleInterface;
use Lmc\Rbac\Role\RoleProviderInterface as BaseRoleProviderInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Role/TraversalStrategyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace LmcRbacMvc\Role;

use Laminas\Permissions\Rbac\RoleInterface;
use Lmc\Rbac\Role\RoleInterface;
use Traversable;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Service/RoleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@

namespace LmcRbacMvc\Service;

use Laminas\Permissions\Rbac\RoleInterface;
use Lmc\Rbac\Role\RoleInterface;
use Lmc\Rbac\Service\RoleServiceInterface;
use Traversable;
use Lmc\Rbac\Exception;
use Lmc\Rbac\Identity\IdentityInterface;
use LmcRbacMvc\Identity\IdentityProviderInterface;
use LmcRbacMvc\Role\RoleProviderInterface;
use LmcRbacMvc\Role\TraversalStrategyInterface;

/**
Expand Down
20 changes: 17 additions & 3 deletions tests/Service/RoleServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

namespace LmcRbacMvcTest\Service;

use Lmc\Rbac\Role\Role;
use LmcRbacMvc\Identity\IdentityInterface;
use LmcRbacMvc\Identity\IdentityProviderInterface;
use LmcRbacMvc\Role\InMemoryRoleProvider;
use LmcRbacMvc\Role\RoleProviderInterface;
use LmcRbacMvc\Service\RoleService;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use LmcRbacMvc\Role\RecursiveRoleIteratorStrategy;
use LmcRbacMvc\Role\TraversalStrategyInterface;
Expand Down Expand Up @@ -178,13 +180,25 @@ public static function roleProvider(): array
'member'
],
'doesMatch' => true
],
// With Role objects
[
'rolesConfig' => [
'member',
'guest'
],
'identityRoles' => [
'member'
],
'rolesToCheck' => [
new Role('member'),
],
'doesMatch' => true
]
];
}

/**
* @dataProvider roleProvider
*/
#[DataProvider('roleProvider')]
public function testMatchIdentityRoles(array $rolesConfig, array $identityRoles, array $rolesToCheck, $doesMatch)
{
$identity = $this->createMock('Lmc\Rbac\Identity\IdentityInterface');
Expand Down

0 comments on commit cadeced

Please sign in to comment.