mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
In between commit Exception refactoring
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
namespace Tests\Unit\Attribut;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Exception\NoValidChoiceException;
|
||||
use Infinito\Attribut\ActionTypeAttributInterface;
|
||||
use Infinito\Attribut\ActionTypeAttribut;
|
||||
use Infinito\DBAL\Types\ActionType;
|
||||
use Infinito\Exception\Type\InvalidChoiceTypeException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -37,7 +37,7 @@ class ActionTypeAttributTest extends TestCase
|
||||
$this->assertNull($this->actionTypeAttribut->setActionType($enum));
|
||||
$this->assertEquals($enum, $this->actionTypeAttribut->getActionType());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->expectException(InvalidChoiceTypeException::class);
|
||||
$this->actionTypeAttribut->setActionType('NoneValidType');
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Attribut\CrudAttributInterface;
|
||||
use Infinito\Attribut\CrudAttribut;
|
||||
use Infinito\DBAL\Types\Meta\Right\CRUDType;
|
||||
use Infinito\Exception\NoValidChoiceException;
|
||||
use Infinito\Exception\Type\InvalidChoiceTypeException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -37,7 +37,7 @@ class CrudAttributTest extends TestCase
|
||||
$this->assertNull($this->crudAttribut->setCrud($enum));
|
||||
$this->assertEquals($enum, $this->crudAttribut->getCrud());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->expectException(InvalidChoiceTypeException::class);
|
||||
$this->crudAttribut->setCrud('NoneValidType');
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Attribut\LayerAttributInterface;
|
||||
use Infinito\Attribut\LayerAttribut;
|
||||
use Infinito\DBAL\Types\Meta\Right\LayerType;
|
||||
use Infinito\Exception\NoValidChoiceException;
|
||||
use Infinito\Exception\Type\InvalidChoiceTypeException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -37,7 +37,7 @@ class LayerAttributTest extends TestCase
|
||||
$this->assertNull($this->layerAttribut->setLayer($enum));
|
||||
$this->assertEquals($enum, $this->layerAttribut->getLayer());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->expectException(InvalidChoiceTypeException::class);
|
||||
$this->layerAttribut->setLayer('NoneValidLayer');
|
||||
}
|
||||
}
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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');
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -8,8 +8,8 @@ use Infinito\Entity\Meta\RightInterface;
|
||||
use Infinito\Entity\Meta\Right;
|
||||
use Infinito\Entity\Meta\Law;
|
||||
use Infinito\DBAL\Types\Meta\Right\LayerType;
|
||||
use Infinito\Exception\NoValidChoiceException;
|
||||
use Infinito\Entity\Source\AbstractSource;
|
||||
use Infinito\Exception\Type\InvalidChoiceTypeException;
|
||||
|
||||
/**
|
||||
* @todo Implement reciever test
|
||||
@@ -77,7 +77,7 @@ class RightTest extends TestCase
|
||||
$this->assertNull($this->right->setActionType($enum));
|
||||
$this->assertEquals($enum, $this->right->getActionType());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->expectException(InvalidChoiceTypeException::class);
|
||||
$this->right->setActionType('NoneValidType');
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class RightTest extends TestCase
|
||||
$this->assertNull($this->right->setLayer($choice));
|
||||
$this->assertEquals($choice, $this->right->getLayer());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->expectException(InvalidChoiceTypeException::class);
|
||||
$this->right->setLayer('NoneValidLayer');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user