mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 22:37:28 +01:00
32 lines
1.2 KiB
PHP
32 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace tests\Unit\Domain\ActionManagement;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use App\Domain\ActionManagement\ActionService;
|
|
use App\Domain\RequestManagement\Action\RequestedActionInterface;
|
|
use App\Domain\SecureManagement\SecureRequestedRightCheckerInterface;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*/
|
|
class ActionServiceTest extends TestCase
|
|
{
|
|
public function testIsRequestedActionSecure()
|
|
{
|
|
$requestedAction = $this->createMock(RequestedActionInterface::class);
|
|
$secureRequestedRightChecker = $this->createMock(SecureRequestedRightCheckerInterface::class);
|
|
$secureRequestedRightChecker->method('check')->willReturn(true);
|
|
$actionService = new ActionService($requestedAction, $secureRequestedRightChecker);
|
|
$this->assertTrue($actionService->isRequestedActionSecure());
|
|
}
|
|
|
|
public function testRequestedActionGetter()
|
|
{
|
|
$requestedAction = $this->createMock(RequestedActionInterface::class);
|
|
$secureRequestedRightChecker = $this->createMock(SecureRequestedRightCheckerInterface::class);
|
|
$actionService = new ActionService($requestedAction, $secureRequestedRightChecker);
|
|
$this->assertInstanceOf(RequestedActionInterface::class, $actionService->getRequestedAction());
|
|
}
|
|
}
|