Renamed class RequestedUserRightFacade to RequestedUserRight

This commit is contained in:
Kevin Frantz 2019-01-18 18:01:54 +01:00
parent effb1fc6da
commit 727a5c2aaf
7 changed files with 24 additions and 24 deletions

View File

@ -9,7 +9,7 @@ use App\Exception\SetNotPossibleException;
/**
* @author kevinfrantz
*/
class RequestedUserRightFacade implements RequestedUserRightFacadeInterface
class RequestedUserRight implements RequestedUserRightInterface
{
/**
* @var UserSourceDirectorInterface

View File

@ -1,10 +0,0 @@
<?php
namespace App\Domain\RequestManagement;
/**
* @author kevinfrantz
*/
interface RequestedUserRightFacadeServiceInterface extends RequestedUserRightFacadeInterface
{
}

View File

@ -7,6 +7,6 @@ namespace App\Domain\RequestManagement;
*
* @author kevinfrantz
*/
interface RequestedUserRightFacadeInterface extends RequestedRightInterface
interface RequestedUserRightInterface extends RequestedRightInterface
{
}

View File

@ -7,7 +7,7 @@ use App\Domain\UserManagement\UserSourceDirectorServiceInterface;
/**
* @author kevinfrantz
*/
final class RequestedUserRightFacadeService extends RequestedUserRightFacade implements RequestedUserRightFacadeServiceInterface
final class RequestedUserRightService extends RequestedUserRight implements RequestedUserRightServiceInterface
{
/**
* @param UserSourceDirectorServiceInterface $userSourceDirectorService

View File

@ -0,0 +1,10 @@
<?php
namespace App\Domain\RequestManagement;
/**
* @author kevinfrantz
*/
interface RequestedUserRightServiceInterface extends RequestedUserRightInterface
{
}

View File

@ -3,21 +3,21 @@
namespace tests\Unit\Domain\RequestManagement;
use PHPUnit\Framework\TestCase;
use App\Domain\RequestManagement\RequestedUserRightFacadeService;
use App\Domain\RequestManagement\RequestedUserRightService;
use App\Domain\UserManagement\UserSourceDirectorServiceInterface;
use App\Domain\RequestManagement\RequestedUserRightFacadeServiceInterface;
use App\Domain\RequestManagement\RequestedUserRightServiceInterface;
use App\Domain\RequestManagement\RequestedRightServiceInterface;
/**
* @author kevinfrantz
*/
class RequestedUserRightFacadeServiceTest extends TestCase
class RequestedUserRightServiceTest extends TestCase
{
public function testConstructorSet(): void
{
$requestedRightService = $this->createMock(RequestedRightServiceInterface::class);
$userSourceDirectorService = $this->createMock(UserSourceDirectorServiceInterface::class);
$service = new RequestedUserRightFacadeService($userSourceDirectorService, $requestedRightService);
$this->assertInstanceOf(RequestedUserRightFacadeServiceInterface::class, $service);
$service = new RequestedUserRightService($userSourceDirectorService, $requestedRightService);
$this->assertInstanceOf(RequestedUserRightServiceInterface::class, $service);
}
}

View File

@ -4,7 +4,7 @@ namespace tests\Unit\Domain\RightManagement;
use PHPUnit\Framework\TestCase;
use App\Entity\User;
use App\Domain\RequestManagement\RequestedUserRightFacade;
use App\Domain\RequestManagement\RequestedUserRight;
use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Source\AbstractSource;
@ -21,13 +21,13 @@ use App\Exception\SetNotPossibleException;
/**
* @author kevinfrantz
*/
class RequestedUserRightFacadeTest extends TestCase
class RequestedUserRightTest extends TestCase
{
public function testInterface(): void
{
$userSourceDirector = $this->createMock(UserSourceDirectorInterface::class);
$requestedRight = $this->createMock(RequestedRightInterface::class);
$requestedUserRightFacade = new RequestedUserRightFacade($userSourceDirector, $requestedRight);
$requestedUserRightFacade = new RequestedUserRight($userSourceDirector, $requestedRight);
$this->assertInstanceOf(RequestedRightInterface::class, $requestedUserRightFacade);
}
@ -46,7 +46,7 @@ class RequestedUserRightFacadeTest extends TestCase
$requestedRight->method('getLayer')->willReturn($layer);
$requestedRight->method('getCrud')->willReturn($type);
$requestedRight->method('getSource')->willReturn($source);
$requestedUserRightFacade = new RequestedUserRightFacade($userSourceDirector, $requestedRight);
$requestedUserRightFacade = new RequestedUserRight($userSourceDirector, $requestedRight);
$this->assertEquals($layer, $requestedUserRightFacade->getLayer());
$this->assertEquals($type, $requestedUserRightFacade->getCrud());
$this->assertEquals($source, $requestedUserRightFacade->getSource());
@ -64,7 +64,7 @@ class RequestedUserRightFacadeTest extends TestCase
$requestedRight = new RequestedRight($sourceRepository);
$user = $this->createMock(User::class);
$userSourceDirector = new UserSourceDirector($sourceRepository, $user);
$requestedUserRightFacade = new RequestedUserRightFacade($userSourceDirector, $requestedRight);
$requestedUserRightFacade = new RequestedUserRight($userSourceDirector, $requestedRight);
$this->assertNull($requestedUserRightFacade->setLayer($layer));
$this->assertNull($requestedUserRightFacade->setCrud($type));
$this->assertNull($requestedUserRightFacade->setRequestedSource($requestedSource));
@ -79,7 +79,7 @@ class RequestedUserRightFacadeTest extends TestCase
$reciever = $this->createMock(AbstractSource::class);
$userSourceDirector = $this->createMock(UserSourceDirectorInterface::class);
$requestedRight = $this->createMock(RequestedRightInterface::class);
$requestedUserRightFacade = new RequestedUserRightFacade($userSourceDirector, $requestedRight);
$requestedUserRightFacade = new RequestedUserRight($userSourceDirector, $requestedRight);
$this->expectException(SetNotPossibleException::class);
$requestedUserRightFacade->setReciever($reciever);
}