From 854121c561213b65f0ee7ae9fcc7187a0b96a6dc Mon Sep 17 00:00:00 2001 From: marcelmanzel Date: Wed, 7 Aug 2024 22:45:48 +0200 Subject: [PATCH] OXDEV-8215: Remove ComponentFiltersInterface; Add missing services; --- src/Module/Controller/ModuleListController.php | 2 +- src/Module/services.yaml | 3 --- src/Shared/services.yaml | 5 ++++- src/Theme/Controller/ThemeListController.php | 2 +- src/Theme/services.yaml | 3 --- tests/Codeception/Acceptance/Module/ModuleListCest.php | 5 ++--- tests/Codeception/Acceptance/Theme/ThemeListCest.php | 2 +- tests/Unit/Module/Controller/ModuleListControllerTest.php | 2 +- tests/Unit/Theme/Controller/ThemeListControllerTest.php | 2 +- 9 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/Module/Controller/ModuleListController.php b/src/Module/Controller/ModuleListController.php index 9205064..3c74a74 100644 --- a/src/Module/Controller/ModuleListController.php +++ b/src/Module/Controller/ModuleListController.php @@ -30,7 +30,7 @@ public function __construct( #[Query] #[Logged] #[Right('LIST_MODULES')] - public function modulesList(?ComponentFiltersInterface $filters): array + public function modulesList(?ComponentFilters $filters): array { return $this->moduleListService->getModuleList($filters ?? new ComponentFilters()); } diff --git a/src/Module/services.yaml b/src/Module/services.yaml index c9c7962..2ce28cc 100644 --- a/src/Module/services.yaml +++ b/src/Module/services.yaml @@ -10,9 +10,6 @@ services: OxidEsales\GraphQL\ConfigurationAccess\Module\Service\ModuleSettingServiceInterface: class: OxidEsales\GraphQL\ConfigurationAccess\Module\Service\ModuleSettingService - OxidEsales\GraphQL\ConfigurationAccess\Module\Service\ModuleFilterServiceInterface: - class: OxidEsales\GraphQL\ConfigurationAccess\Module\Service\ModuleFilterService - OxidEsales\GraphQL\ConfigurationAccess\Module\DataType\ModuleDataTypeFactoryInterface: class: OxidEsales\GraphQL\ConfigurationAccess\Module\DataType\ModuleDataTypeFactory diff --git a/src/Shared/services.yaml b/src/Shared/services.yaml index 74ff2d2..48ba9fe 100644 --- a/src/Shared/services.yaml +++ b/src/Shared/services.yaml @@ -13,5 +13,8 @@ services: OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\CollectionEncodingServiceInterface: class: OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\JsonCollectionEncodingService - OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\LanguageServiceInnterface: + OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\LanguageServiceInterface: class: \OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\LanguageService + + OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\ComponentFilterServiceInterface: + class: \OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\ComponentFilterService diff --git a/src/Theme/Controller/ThemeListController.php b/src/Theme/Controller/ThemeListController.php index a22c05a..556c8d1 100644 --- a/src/Theme/Controller/ThemeListController.php +++ b/src/Theme/Controller/ThemeListController.php @@ -31,7 +31,7 @@ public function __construct( #[Query] #[Logged] #[Right('LIST_THEMES')] - public function themesList(?ComponentFiltersInterface $filters): array + public function themesList(?ComponentFilters $filters): array { return $this->themeListService->getThemeList($filters ?? new ComponentFilters()); } diff --git a/src/Theme/services.yaml b/src/Theme/services.yaml index 5d50324..e81ec50 100644 --- a/src/Theme/services.yaml +++ b/src/Theme/services.yaml @@ -22,9 +22,6 @@ services: OxidEsales\GraphQL\ConfigurationAccess\Theme\DataType\ThemeDataTypeFactoryInterface: class: OxidEsales\GraphQL\ConfigurationAccess\Theme\DataType\ThemeDataTypeFactory - OxidEsales\GraphQL\ConfigurationAccess\Theme\Service\ThemeFilterServiceInterface: - class: OxidEsales\GraphQL\ConfigurationAccess\Theme\Service\ThemeFilterService - OxidEsales\GraphQL\ConfigurationAccess\Theme\Service\ThemeListServiceInterface: class: OxidEsales\GraphQL\ConfigurationAccess\Theme\Service\ThemeListService diff --git a/tests/Codeception/Acceptance/Module/ModuleListCest.php b/tests/Codeception/Acceptance/Module/ModuleListCest.php index 6dc869d..1cfd607 100644 --- a/tests/Codeception/Acceptance/Module/ModuleListCest.php +++ b/tests/Codeception/Acceptance/Module/ModuleListCest.php @@ -9,15 +9,14 @@ namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Codeception\Acceptance\Module; +use OxidEsales\GraphQL\ConfigurationAccess\Tests\Codeception\Acceptance\BaseCest; use OxidEsales\GraphQL\ConfigurationAccess\Tests\Codeception\AcceptanceTester; -use function PHPUnit\Framework\assertCount; - /** * @group module_list * @group oe_graphql_configuration_access */ -final class ModuleListCest extends ModuleSettingBaseCest +final class ModuleListCest extends BaseCest { public function testModuleListAuthorized(AcceptanceTester $I): void { diff --git a/tests/Codeception/Acceptance/Theme/ThemeListCest.php b/tests/Codeception/Acceptance/Theme/ThemeListCest.php index 4271846..6d143bd 100644 --- a/tests/Codeception/Acceptance/Theme/ThemeListCest.php +++ b/tests/Codeception/Acceptance/Theme/ThemeListCest.php @@ -37,7 +37,7 @@ private function runThemeListQuery(AcceptanceTester $I): array filters: null ) { title - identifier + id version description active diff --git a/tests/Unit/Module/Controller/ModuleListControllerTest.php b/tests/Unit/Module/Controller/ModuleListControllerTest.php index a757896..dc7cadd 100644 --- a/tests/Unit/Module/Controller/ModuleListControllerTest.php +++ b/tests/Unit/Module/Controller/ModuleListControllerTest.php @@ -23,7 +23,7 @@ class ModuleListControllerTest extends UnitTestCase { public function testModulesListWithFilters(): void { - $filtersStub = $this->createStub(ComponentFiltersInterface::class); + $filtersStub = $this->createStub(ComponentFilters::class); $moduleStub1 = $this->createStub(ModuleDataTypeInterface::class); $moduleStub2 = $this->createStub(ModuleDataTypeInterface::class); $filteredModules = [$moduleStub1, $moduleStub2]; diff --git a/tests/Unit/Theme/Controller/ThemeListControllerTest.php b/tests/Unit/Theme/Controller/ThemeListControllerTest.php index 4d3a75b..31a60fc 100644 --- a/tests/Unit/Theme/Controller/ThemeListControllerTest.php +++ b/tests/Unit/Theme/Controller/ThemeListControllerTest.php @@ -24,7 +24,7 @@ class ThemeListControllerTest extends TestCase public function testThemesListWithFilter(): void { $theme = $this->createStub(ThemeDataTypeInterface::class); - $themeFilters = $this->createStub(ComponentFiltersInterface::class); + $themeFilters = $this->createStub(ComponentFilters::class); $themeListServiceMock = $this->createMock(ThemeListServiceInterface::class); $themeListServiceMock->expects($this->once())