Finished refactoring of exceptions

This commit is contained in:
Kevin Frantz
2019-04-15 01:37:17 +02:00
parent 9f179ead73
commit 06f69675ac
49 changed files with 159 additions and 135 deletions

View File

@@ -12,10 +12,10 @@ use Infinito\Domain\UserManagement\UserSourceDirectorInterface;
use Infinito\Domain\RequestManagement\Right\RequestedRightInterface;
use Infinito\Domain\RequestManagement\Right\RequestedRight;
use Infinito\Domain\RequestManagement\Entity\RequestedEntityInterface;
use Infinito\Exception\SetNotPossibleException;
use Infinito\Entity\Source\SourceInterface;
use Infinito\Domain\RequestManagement\Right\AbstractRequestedRightFacade;
use Infinito\Domain\FixtureManagement\FixtureSource\ImpressumFixtureSource;
use Infinito\Exception\Collection\NotPossibleSetElementException;
/**
* @author kevinfrantz
@@ -88,7 +88,7 @@ class AbstractRequestedRightFacadeTest extends TestCase
$userSourceDirector = $this->createMock(UserSourceDirectorInterface::class);
$requestedRight = $this->createMock(RequestedRightInterface::class);
$requestedUserRightFacade = new RequestedUser($userSourceDirector, $requestedRight);
$this->expectException(SetNotPossibleException::class);
$this->expectException(NotPossibleSetElementException::class);
$requestedUserRightFacade->setReciever($reciever);
}
}

View File

@@ -8,7 +8,6 @@ use Infinito\Domain\RequestManagement\Right\RequestedRight;
use Infinito\DBAL\Types\Meta\Right\LayerType;
use Infinito\Domain\RequestManagement\Entity\RequestedEntity;
use Infinito\Domain\RequestManagement\Entity\RequestedEntityInterface;
use Infinito\Exception\PreconditionFailedException;
use Infinito\Entity\Source\PureSource;
use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryService;
@@ -16,8 +15,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Infinito\Entity\Meta\Law;
use Infinito\Entity\Source\SourceInterface;
use Infinito\DBAL\Types\ActionType;
use Infinito\Exception\AllreadySetException;
use Infinito\Domain\FixtureManagement\FixtureSource\ImpressumFixtureSource;
use Infinito\Exception\Core\NoIdentityCoreException;
use Infinito\Exception\Collection\ContainsElementException;
/**
* @author kevinfrantz
@@ -59,7 +59,7 @@ class RequestedRightTest extends KernelTestCase
{
$requestedSource = $this->createMock(RequestedEntity::class);
$this->requestedRight->setRequestedEntity($requestedSource);
$this->expectException(PreconditionFailedException::class);
$this->expectException(NoIdentityCoreException::class);
$this->requestedRight->getSource();
}
@@ -83,6 +83,7 @@ class RequestedRightTest extends KernelTestCase
$requestedEntity = $this->createMock(RequestedEntityInterface::class);
$requestedEntity->method('getSlug')->willReturn($slug);
$requestedEntity->method('hasSlug')->willReturn(true);
$requestedEntity->method('hasIdentity')->willReturn(true);
$requestedEntity->method('getEntity')->willReturn($requestedEntityEntity);
$this->assertEquals($slug, $requestedEntity->getSlug());
$this->requestedRight->setRequestedEntity($requestedEntity);
@@ -101,6 +102,7 @@ class RequestedRightTest extends KernelTestCase
$requestedEntity->method('getSlug')->willReturn($slug);
$requestedEntity->method('hasSlug')->willReturn(true);
$requestedEntity->method('getEntity')->willReturn($entity);
$requestedEntity->method('hasIdentity')->willReturn(true);
$this->assertEquals($slug, $requestedEntity->getSlug());
$this->requestedRight->setRequestedEntity($requestedEntity);
$this->requestedRight->setLayer(LayerType::LAW);
@@ -113,7 +115,7 @@ class RequestedRightTest extends KernelTestCase
$attributType = ActionType::CREATE;
$this->requestedRight->setActionType($attributType);
$this->assertEquals($attributType, $this->requestedRight->getActionType());
$this->expectException(AllreadySetException::class);
$this->expectException(ContainsElementException::class);
$this->requestedRight->setActionType($attributType);
}
}