mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized RequestManagement and pushed code coverage for it to 100%
This commit is contained in:
@@ -14,6 +14,8 @@ use App\Entity\Source\PureSource;
|
||||
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
|
||||
use App\Domain\RepositoryManagement\LayerRepositoryFactoryService;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use App\Entity\Meta\Law;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -48,7 +50,7 @@ class RequestedRightTest extends KernelTestCase
|
||||
public function testLayerException(): void
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
var_dump($this->requestedRight->getLayer());
|
||||
$this->requestedRight->getLayer();
|
||||
}
|
||||
|
||||
public function testRequestedEntityWithoutAttributes(): void
|
||||
@@ -86,4 +88,21 @@ class RequestedRightTest extends KernelTestCase
|
||||
$responseSource2 = $this->requestedRight->getSource();
|
||||
$this->assertEquals($responseSource1, $responseSource2);
|
||||
}
|
||||
|
||||
public function testMetaEntity(): void
|
||||
{
|
||||
$slug = 123;
|
||||
$source = $this->createMock(SourceInterface::class);
|
||||
$entity = new Law();
|
||||
$entity->setSource($source);
|
||||
$requestedEntity = $this->createMock(RequestedEntityInterface::class);
|
||||
$requestedEntity->method('getSlug')->willReturn($slug);
|
||||
$requestedEntity->method('hasSlug')->willReturn(true);
|
||||
$requestedEntity->method('getEntity')->willReturn($entity);
|
||||
$this->assertEquals($slug, $requestedEntity->getSlug());
|
||||
$this->requestedRight->setRequestedEntity($requestedEntity);
|
||||
$this->requestedRight->setLayer(LayerType::LAW);
|
||||
$responseSource1 = $this->requestedRight->getSource();
|
||||
$this->assertEquals($responseSource1, $source);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user