-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from visto9259/fix-138-139
Fixed UnauthorizedException to be a throwable exception. Fixed GuardPluginManager factory to use 'guard_manager' config
- Loading branch information
Showing
10 changed files
with
189 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace LmcTest\Rbac\Mvc\Asset; | ||
|
||
use Laminas\EventManager\EventManagerInterface; | ||
use Laminas\Mvc\MvcEvent; | ||
use Lmc\Rbac\Mvc\Guard\AbstractGuard; | ||
|
||
class TestGuard extends AbstractGuard | ||
{ | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function isGranted(MvcEvent $event): bool | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace LmcTest\Rbac\Mvc\Exception; | ||
|
||
use Lmc\Rbac\Mvc\Exception\UnauthorizedException; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class UnauthorizedExceptionTest extends TestCase | ||
{ | ||
public function testUnauthorizedException(): void | ||
{ | ||
$this->expectException(UnauthorizedException::class); | ||
$this->expectExceptionMessage('You are not authorized to access this resource'); | ||
throw new UnauthorizedException(); | ||
} | ||
|
||
public function testUnauthorizedExceptionMessage(): void | ||
{ | ||
$this->expectExceptionMessage('foo'); | ||
throw new UnauthorizedException('foo'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.