mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Implemented getChoices and getValues from Doctrine ENUM on the right way
This commit is contained in:
@@ -14,7 +14,7 @@ class LayerActionMapTest extends TestCase
|
||||
{
|
||||
public function testGetLayersBySource(): void
|
||||
{
|
||||
foreach (ActionType::getChoices() as $action) {
|
||||
foreach (ActionType::getValues() as $action) {
|
||||
$layers = LayerActionMap::getLayers($action);
|
||||
$this->assertArraySubset([LayerType::SOURCE], $layers);
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class LayerActionMapTest extends TestCase
|
||||
public function testGetActionsBySource(): void
|
||||
{
|
||||
$actions = LayerActionMap::getActions(LayerType::SOURCE);
|
||||
foreach (ActionType::getChoices() as $action) {
|
||||
foreach (ActionType::getValues() as $action) {
|
||||
$this->assertTrue(in_array($action, $actions));
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class RequestedActionTest extends TestCase
|
||||
|
||||
public function testCrud(): void
|
||||
{
|
||||
foreach (CRUDType::getChoices() as $crud) {
|
||||
foreach (CRUDType::getValues() as $crud) {
|
||||
$this->action->setActionType($crud);
|
||||
$this->assertEquals($crud, $this->action->getActionType());
|
||||
$this->assertEquals($crud, $this->requestedRight->getActionType());
|
||||
@@ -66,7 +66,7 @@ class RequestedActionTest extends TestCase
|
||||
|
||||
public function testLayer(): void
|
||||
{
|
||||
foreach (LayerType::getChoices() as $LayerType) {
|
||||
foreach (LayerType::getValues() as $LayerType) {
|
||||
$this->action->setLayer($LayerType);
|
||||
$this->assertEquals($LayerType, $this->action->getLayer());
|
||||
$this->assertEquals($LayerType, $this->requestedRight->getLayer());
|
||||
|
@@ -30,7 +30,7 @@ class RightLayerCombinationServiceTest extends TestCase
|
||||
|
||||
public function testBySource(): void
|
||||
{
|
||||
foreach (CRUDType::getChoices() as $crudType) {
|
||||
foreach (CRUDType::getValues() as $crudType) {
|
||||
$layers = $this->rightLayerCombinationService->getPossibleLayers($crudType);
|
||||
$this->assertContains(LayerType::SOURCE, $layers);
|
||||
$sourceCruds = $this->rightLayerCombinationService->getPossibleCruds(LayerType::SOURCE);
|
||||
|
@@ -59,7 +59,7 @@ class ActionTemplateDataStoreServiceTest extends TestCase
|
||||
|
||||
public function testAccessors(): void
|
||||
{
|
||||
foreach (ActionType::getChoices() as $actionType) {
|
||||
foreach (ActionType::getValues() as $actionType) {
|
||||
$instance = ActionTemplateDataStoreService::ACTION_DATA_MAPPING[$actionType];
|
||||
$data = $this->createMock($instance);
|
||||
$this->assertFalse($this->actionTemplateDataStoreService->isDataStored($actionType));
|
||||
|
@@ -29,7 +29,7 @@ class TemplatePathFormAndViewTest extends TestCase
|
||||
|
||||
public function testTypeReload(): void
|
||||
{
|
||||
foreach (RESTResponseType::getChoices() as $type) {
|
||||
foreach (RESTResponseType::getValues() as $type) {
|
||||
$this->templatePathFormAndView->reloadType($type);
|
||||
$this->assertEquals(self::BASE_PATH.$type.'.twig', $this->templatePathFormAndView->getView()->getAtomTemplatePath());
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ class TemplatePathInformationTest extends TestCase
|
||||
|
||||
public function testSetType(): void
|
||||
{
|
||||
foreach (RESTResponseType::getChoices() as $type) {
|
||||
foreach (RESTResponseType::getValues() as $type) {
|
||||
$this->templateMeta->reloadType($type);
|
||||
$this->assertEquals($this->getExpectedPath($type, 'atom'), $this->templateMeta->getAtomTemplatePath());
|
||||
$this->assertEquals($this->getExpectedPath($type, 'molecule'), $this->templateMeta->getMoleculeTemplatePath());
|
||||
|
@@ -36,7 +36,7 @@ class ActionIconClassMapTest extends TestCase
|
||||
|
||||
public function testAllActionsSet(): void
|
||||
{
|
||||
foreach (ActionType::getChoices() as $action) {
|
||||
foreach (ActionType::getValues() as $action) {
|
||||
$this->assertIsString($this->actionIconClassMap->getIconClass($action));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user