mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Covered Request Management Services with Unit Tests
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace tests\Integration\Domain\RequestManagement\Right;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
|
||||
use App\DBAL\Types\Meta\Right\LayerType;
|
||||
use App\Repository\Meta\LawRepository;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class LayerRepositoryFactoryServiceIntegrationTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var LayerRepositoryFactoryServiceInterface
|
||||
*/
|
||||
private $layerRepositoryFactoryService;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \PHPUnit\Framework\TestCase::setUp()
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->layerRepositoryFactoryService = self::$container->get(LayerRepositoryFactoryServiceInterface::class);
|
||||
}
|
||||
|
||||
public function testLayer(): void
|
||||
{
|
||||
$layer = LayerType::LAW;
|
||||
$this->assertInstanceOf(LawRepository::class, $this->layerRepositoryFactoryService->getRepository($layer));
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace tests\Integration\Domain\RequestManagement\Action;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
|
||||
use App\DBAL\Types\ActionType;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class RequestedActionServiceIntegrationTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var RequestedActionServiceInterface
|
||||
*/
|
||||
private $requestedActionService;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \PHPUnit\Framework\TestCase::setUp()
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->requestedActionService = self::$container->get(RequestedActionServiceInterface::class);
|
||||
}
|
||||
|
||||
public function testActionAccessors(): void
|
||||
{
|
||||
$actionType = ActionType::THREAD;
|
||||
$this->assertNull($this->requestedActionService->setActionType($actionType));
|
||||
$this->assertEquals($actionType, $this->requestedActionService->getActionType());
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace tests\Integration\Domain\RequestManagement\Right;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use App\Domain\RequestManagement\Right\RequestedRightServiceInterface;
|
||||
use App\DBAL\Types\Meta\Right\CRUDType;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class RequestedRightServiceIntegrationTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var RequestedRightServiceInterface
|
||||
*/
|
||||
private $requestedRightService;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \PHPUnit\Framework\TestCase::setUp()
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->requestedRightService = self::$container->get(RequestedRightServiceInterface::class);
|
||||
}
|
||||
|
||||
public function testClassAccessors(): void
|
||||
{
|
||||
$crud = CRUDType::READ;
|
||||
$this->assertNull($this->requestedRightService->setCrud($crud));
|
||||
$this->assertEquals($crud, $this->requestedRightService->getCrud());
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace tests\Integration\Domain\RequestManagement\Right;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use App\DBAL\Types\Meta\Right\CRUDType;
|
||||
use App\Domain\RequestManagement\User\RequestedUserServiceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class RequestedUserServiceIntegrationTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var RequestedUserServiceInterface
|
||||
*/
|
||||
private $requestedUserService;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \PHPUnit\Framework\TestCase::setUp()
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->requestedUserService = self::$container->get(RequestedUserServiceInterface::class);
|
||||
}
|
||||
|
||||
public function testCrudAccessors(): void
|
||||
{
|
||||
$crud = CRUDType::READ;
|
||||
$this->assertNull($this->requestedUserService->setCrud($crud));
|
||||
$this->assertEquals($crud, $this->requestedUserService->getCrud());
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace tests\Integration\Domain\UserManagement;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use App\Domain\UserManagement\UserSourceDirectorServiceInterface;
|
||||
use App\Entity\UserInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class UserSourceDirectorServiceIntegrationTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var UserSourceDirectorServiceInterface
|
||||
*/
|
||||
private $userSourceDirectorService;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \PHPUnit\Framework\TestCase::setUp()
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->userSourceDirectorService = self::$container->get(UserSourceDirectorServiceInterface::class);
|
||||
}
|
||||
|
||||
public function testCrudAccessors(): void
|
||||
{
|
||||
$this->assertInstanceOf(UserInterface::class, $this->userSourceDirectorService->getUser());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user