From be77e3a0ab655d26c0436289cfd67b50218c5b85 Mon Sep 17 00:00:00 2001 From: Marcel Diegelmann Date: Tue, 14 Oct 2025 13:58:46 +0200 Subject: [PATCH] PartCustomState: Anpassungen bzgl. Tests --- src/DataFixtures/DataStructureFixtures.php | 3 ++- src/Services/UserSystem/PermissionPresetsHelper.php | 1 + tests/Twig/EntityExtensionTest.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DataFixtures/DataStructureFixtures.php b/src/DataFixtures/DataStructureFixtures.php index fc713d4d..9c685338 100644 --- a/src/DataFixtures/DataStructureFixtures.php +++ b/src/DataFixtures/DataStructureFixtures.php @@ -24,6 +24,7 @@ namespace App\DataFixtures; use App\Entity\Attachments\AttachmentType; use App\Entity\Base\AbstractStructuralDBElement; +use App\Entity\Parts\PartCustomState; use App\Entity\ProjectSystem\Project; use App\Entity\Parts\Category; use App\Entity\Parts\Footprint; @@ -50,7 +51,7 @@ class DataStructureFixtures extends Fixture implements DependentFixtureInterface { //Reset autoincrement $types = [AttachmentType::class, Project::class, Category::class, Footprint::class, Manufacturer::class, - MeasurementUnit::class, StorageLocation::class, Supplier::class,]; + MeasurementUnit::class, StorageLocation::class, Supplier::class, PartCustomState::class]; foreach ($types as $type) { $this->createNodesForClass($type, $manager); diff --git a/src/Services/UserSystem/PermissionPresetsHelper.php b/src/Services/UserSystem/PermissionPresetsHelper.php index a6301388..a3ed01b8 100644 --- a/src/Services/UserSystem/PermissionPresetsHelper.php +++ b/src/Services/UserSystem/PermissionPresetsHelper.php @@ -132,6 +132,7 @@ class PermissionPresetsHelper $this->permissionResolver->setAllOperationsOfPermissionExcept($permHolder, 'attachment_types', PermissionData::ALLOW, ['import']); $this->permissionResolver->setAllOperationsOfPermissionExcept($permHolder, 'currencies', PermissionData::ALLOW, ['import']); $this->permissionResolver->setAllOperationsOfPermissionExcept($permHolder, 'measurement_units', PermissionData::ALLOW, ['import']); + $this->permissionResolver->setAllOperationsOfPermissionExcept($permHolder, 'part_custom_states', PermissionData::ALLOW, ['import']); $this->permissionResolver->setAllOperationsOfPermissionExcept($permHolder, 'suppliers', PermissionData::ALLOW, ['import']); $this->permissionResolver->setAllOperationsOfPermissionExcept($permHolder, 'projects', PermissionData::ALLOW, ['import']); diff --git a/tests/Twig/EntityExtensionTest.php b/tests/Twig/EntityExtensionTest.php index 3adb9ad2..18fe970b 100644 --- a/tests/Twig/EntityExtensionTest.php +++ b/tests/Twig/EntityExtensionTest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace App\Tests\Twig; use App\Entity\Attachments\PartAttachment; +use App\Entity\Parts\PartCustomState; use App\Entity\ProjectSystem\Project; use App\Entity\LabelSystem\LabelProfile; use App\Entity\Parts\Category; @@ -67,6 +68,7 @@ class EntityExtensionTest extends WebTestCase $this->assertSame('currency', $this->service->getEntityType(new Currency())); $this->assertSame('measurement_unit', $this->service->getEntityType(new MeasurementUnit())); $this->assertSame('label_profile', $this->service->getEntityType(new LabelProfile())); + $this->assertSame('part_custom_state', $this->service->getEntityType(new PartCustomState())); } }