In between commit Exception refactoring

This commit is contained in:
Kevin Frantz
2019-04-14 23:37:30 +02:00
parent 679bfd2079
commit 9f179ead73
64 changed files with 256 additions and 241 deletions

View File

@@ -2,15 +2,15 @@
namespace tests\Integration\Domain\AccessManagement;
use PHPUnit\Framework\TestCase;
use Infinito\Exception\NoValidChoiceException;
use Infinito\Exception\NotSetException;
use Infinito\DBAL\Types\ActionType;
use Infinito\Exception\AllreadySetException;
use Infinito\Exception\NotCorrectInstanceException;
use Infinito\Domain\DataAccessManagement\ActionsResultsDAOService;
use Infinito\Entity\EntityInterface;
use Infinito\Logic\Result\ResultInterface;
use PHPUnit\Framework\TestCase;
use Infinito\Exception\Collection\ContainsElementException;
use Infinito\Exception\Collection\NotSetElementException;
use Infinito\Exception\Type\InvalidChoiceTypeException;
use Infinito\Exception\Core\NotCorrectInstanceCoreException;
use Infinito\Domain\DataAccessManagement\ActionsResultsDAOServiceInterface;
/**
@@ -35,13 +35,13 @@ class ActionResultsDAOServiceTest extends TestCase
public function testNotValidChoiceSetException(): void
{
$this->expectException(NoValidChoiceException::class);
$this->expectException(InvalidChoiceTypeException::class);
$this->actionsResultsDAO->setData('1231232N', ' ');
}
public function testNotCorrectInstanceSetException(): void
{
$this->expectException(NotCorrectInstanceException::class);
$this->expectException(NotCorrectInstanceCoreException::class);
$data = new class() {
};
$this->actionsResultsDAO->setData(ActionType::READ, $data);
@@ -49,13 +49,13 @@ class ActionResultsDAOServiceTest extends TestCase
public function testNotValidChoiceGetException(): void
{
$this->expectException(NoValidChoiceException::class);
$this->expectException(InvalidChoiceTypeException::class);
$this->actionsResultsDAO->getData('1231232N');
}
public function testNotSetGetException(): void
{
$this->expectException(NotSetException::class);
$this->expectException(NotSetElementException::class);
$this->actionsResultsDAO->getData(ActionType::READ);
}
@@ -82,7 +82,7 @@ class ActionResultsDAOServiceTest extends TestCase
$this->assertTrue($this->actionsResultsDAO->isDataStored($actionType));
$this->assertEquals($resultData, $this->actionsResultsDAO->getData($actionType));
}
$this->expectException(AllreadySetException::class);
$this->expectException(ContainsElementException::class);
$this->assertNull($this->actionsResultsDAO->setData($actionType, $resultData));
}
}

View File

@@ -3,7 +3,7 @@
namespace tests\Unit\Domain\FormManagement;
use PHPUnit\Framework\TestCase;
use Infinito\Exception\NotSetException;
use Infinito\Exception\Collection\NotSetException;
use Infinito\Domain\RequestManagement\Action\RequestedActionInterface;
use Infinito\Domain\FormManagement\RequestedActionFormBuilder;
use Infinito\Domain\FormManagement\FormClassNameServiceInterface;

View File

@@ -5,7 +5,7 @@ namespace tests\Unit\Domain\ParameterManagement;
use PHPUnit\Framework\TestCase;
use Infinito\Domain\ParameterManagement\ParameterFactory;
use Infinito\Domain\ParameterManagement\Parameter\VersionParameter;
use Infinito\Exception\NotDefinedException;
use Infinito\Exception\Collection\NotSetElementException;
/**
* @author kevinfrantz
@@ -27,7 +27,7 @@ class ParameterFactoryTest extends TestCase
$versionParameter = $parameterFactory->getParameter('version');
$this->assertInstanceOf(VersionParameter::class, $versionParameter);
$this->assertEquals($versionParameter, $parameterFactory->getParameter('version'));
$this->expectException(NotDefinedException::class);
$this->expectException(NotSetElementException::class);
$versionParameter = $parameterFactory->getParameter('blabalbal');
}
}

View File

@@ -6,7 +6,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryService;
use Infinito\Repository\RepositoryInterface;
use Infinito\Exception\NotSetException;
use Infinito\Exception\Collection\NotSetException;
use Infinito\Domain\LayerManagement\LayerClassMap;
/**

View File

@@ -5,14 +5,14 @@ namespace tests\Unit\Domain\RequestManagement\Entity;
use PHPUnit\Framework\TestCase;
use Infinito\Domain\RequestManagement\Entity\RequestedEntity;
use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
use Infinito\Exception\NotSetException;
use Infinito\Exception\NotCorrectInstanceException;
use Infinito\Domain\RequestManagement\Right\RequestedRightInterface;
use Infinito\DBAL\Types\Meta\Right\LayerType;
use Infinito\Repository\RepositoryInterface;
use Infinito\Entity\EntityInterface;
use Infinito\Entity\Source\AbstractSource;
use Infinito\Exception\AllreadyDefinedException;
use Infinito\Exception\Attribut\UndefinedAttributException;
use Infinito\Exception\NoIdentityCoreException;
use Infinito\Exception\Attribut\AllreadyDefinedAttributException;
/**
* @author kevinfrantz
@@ -37,7 +37,7 @@ class RequestedEntityTest extends TestCase
{
$layerRepositoryFactoryService = $this->createMock(LayerRepositoryFactoryServiceInterface::class);
$requestedEntity = new RequestedEntity($layerRepositoryFactoryService);
$this->expectException(NotSetException::class);
$this->expectException(UndefinedAttributException::class);
$requestedEntity->getEntity();
}
@@ -50,7 +50,7 @@ class RequestedEntityTest extends TestCase
$requestedEntity = new RequestedEntity($layerRepositoryFactoryService);
$requestedEntity->setSlug('abcd');
$requestedEntity->setRequestedRight($requestedRight);
$this->expectException(NotCorrectInstanceException::class);
$this->expectException(NoIdentityCoreException::class);
$requestedEntity->getEntity();
}
@@ -69,7 +69,7 @@ class RequestedEntityTest extends TestCase
$entityResult = $requestedEntity->getEntity();
$this->assertEquals($entityMock, $entityResult);
$this->assertEquals(get_class($entityMock), $requestedEntity->getClass());
$this->expectException(AllreadyDefinedException::class);
$this->expectException(AllreadyDefinedAttributException::class);
$requestedEntity->setClass(AbstractSource::class);
}
@@ -86,7 +86,7 @@ class RequestedEntityTest extends TestCase
$this->assertNull($requestedEntity->setClass($class));
$this->assertTrue($requestedEntity->hasClass());
$this->assertEquals($class, $requestedEntity->getClass());
$this->expectException(AllreadyDefinedException::class);
$this->expectException(AllreadyDefinedAttributException::class);
$requestedEntity->setIdentity('123343');
}
@@ -94,7 +94,7 @@ class RequestedEntityTest extends TestCase
{
$requestedEntity = new RequestedEntity();
$requestedEntity->setSlug('ABABEBA');
$this->expectException(NotSetException::class);
$this->expectException(UndefinedAttributException::class);
$requestedEntity->getEntity();
}
}

View File

@@ -10,7 +10,7 @@ use Infinito\Entity\Meta\RightInterface;
use Infinito\Entity\Meta\Right;
use Infinito\Entity\Meta\Law;
use Infinito\Exception\AllreadySetException;
use Infinito\Exception\NotSetException;
use Infinito\Exception\Collection\NotSetException;
use Infinito\Exception\AllreadyDefinedException;
use Infinito\Entity\Source\PureSource;

View File

@@ -5,7 +5,7 @@ namespace tests\Unit\Domain\TwigManagement;
use PHPUnit\Framework\TestCase;
use Infinito\Domain\TwigManagement\ActionIconClassMapInterface;
use Infinito\Domain\TwigManagement\ActionIconClassMap;
use Infinito\Exception\NotSetException;
use Infinito\Exception\Collection\NotSetException;
use Infinito\DBAL\Types\ActionType;
/**

View File

@@ -3,7 +3,7 @@
namespace tests\Unit\Domain\TwigManagement;
use PHPUnit\Framework\TestCase;
use Infinito\Exception\NotSetException;
use Infinito\Exception\Collection\NotSetException;
use Infinito\Domain\TwigManagement\LayerIconClassMap;
use Infinito\DBAL\Types\Meta\Right\LayerType;