diff --git a/README.md b/README.md index 487e72b..d863a4c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ the API consumer would always have to convert the value after queries or before we decided to use json encoded strings instead. To get the specific type of a configuration, we provide queries like -`getShopSettingsList`/`getModuleSettingsList`/`getThemeSettingsList` to figure out the type for configurations. +`shopSettings`/`moduleSettings`/`themeSettings` to figure out the type for configurations. As a result you get an array of setting types: ``` diff --git a/src/Module/Controller/ModuleSettingController.php b/src/Module/Controller/ModuleSettingController.php index 1729af9..16871b0 100644 --- a/src/Module/Controller/ModuleSettingController.php +++ b/src/Module/Controller/ModuleSettingController.php @@ -21,6 +21,9 @@ use TheCodingMachine\GraphQLite\Annotations\Query; use TheCodingMachine\GraphQLite\Annotations\Right; +/** + * @SuppressWarnings(PHPMD.TooManyPublicMethods) + */ final class ModuleSettingController { public function __construct( @@ -32,7 +35,7 @@ public function __construct( #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getModuleSettingInteger(string $name, string $moduleId): IntegerSetting + public function moduleSettingInteger(string $name, string $moduleId): IntegerSetting { return $this->moduleSettingService->getIntegerSetting($name, $moduleId); } @@ -41,7 +44,7 @@ public function getModuleSettingInteger(string $name, string $moduleId): Integer #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getModuleSettingFloat(string $name, string $moduleId): FloatSetting + public function moduleSettingFloat(string $name, string $moduleId): FloatSetting { return $this->moduleSettingService->getFloatSetting($name, $moduleId); } @@ -50,7 +53,7 @@ public function getModuleSettingFloat(string $name, string $moduleId): FloatSett #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getModuleSettingBoolean(string $name, string $moduleId): BooleanSetting + public function moduleSettingBoolean(string $name, string $moduleId): BooleanSetting { return $this->moduleSettingService->getBooleanSetting($name, $moduleId); } @@ -59,7 +62,7 @@ public function getModuleSettingBoolean(string $name, string $moduleId): Boolean #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getModuleSettingString(string $name, string $moduleId): StringSetting + public function moduleSettingString(string $name, string $moduleId): StringSetting { return $this->moduleSettingService->getStringSetting($name, $moduleId); } @@ -68,7 +71,7 @@ public function getModuleSettingString(string $name, string $moduleId): StringSe #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getModuleSettingCollection(string $name, string $moduleId): StringSetting + public function moduleSettingCollection(string $name, string $moduleId): StringSetting { return $this->moduleSettingService->getCollectionSetting($name, $moduleId); } @@ -77,7 +80,7 @@ public function getModuleSettingCollection(string $name, string $moduleId): Stri #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeModuleSettingInteger(string $name, int $value, string $moduleId): IntegerSetting + public function moduleSettingIntegerChange(string $name, int $value, string $moduleId): IntegerSetting { return $this->moduleSettingService->changeIntegerSetting($name, $value, $moduleId); } @@ -86,7 +89,7 @@ public function changeModuleSettingInteger(string $name, int $value, string $mod #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeModuleSettingFloat(string $name, float $value, string $moduleId): FloatSetting + public function moduleSettingFloatChange(string $name, float $value, string $moduleId): FloatSetting { return $this->moduleSettingService->changeFloatSetting($name, $value, $moduleId); } @@ -95,7 +98,7 @@ public function changeModuleSettingFloat(string $name, float $value, string $mod #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeModuleSettingBoolean(string $name, bool $value, string $moduleId): BooleanSetting + public function moduleSettingBooleanChange(string $name, bool $value, string $moduleId): BooleanSetting { return $this->moduleSettingService->changeBooleanSetting($name, $value, $moduleId); } @@ -104,7 +107,7 @@ public function changeModuleSettingBoolean(string $name, bool $value, string $mo #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeModuleSettingString(string $name, string $value, string $moduleId): StringSetting + public function moduleSettingStringChange(string $name, string $value, string $moduleId): StringSetting { return $this->moduleSettingService->changeStringSetting($name, $value, $moduleId); } @@ -113,7 +116,7 @@ public function changeModuleSettingString(string $name, string $value, string $m #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeModuleSettingCollection(string $name, string $value, string $moduleId): StringSetting + public function moduleSettingCollectionChange(string $name, string $value, string $moduleId): StringSetting { return $this->moduleSettingService->changeCollectionSetting($name, $value, $moduleId); } @@ -125,7 +128,7 @@ public function changeModuleSettingCollection(string $name, string $value, strin #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getModuleSettingsList(string $moduleId): array + public function moduleSettings(string $moduleId): array { return $this->moduleSettingService->getSettingsList($moduleId); } diff --git a/src/Shop/Controller/ShopSettingController.php b/src/Shop/Controller/ShopSettingController.php index 20bca9e..33ba015 100644 --- a/src/Shop/Controller/ShopSettingController.php +++ b/src/Shop/Controller/ShopSettingController.php @@ -21,6 +21,9 @@ use TheCodingMachine\GraphQLite\Annotations\Query; use TheCodingMachine\GraphQLite\Annotations\Right; +/** + * @SuppressWarnings(PHPMD.TooManyPublicMethods) + */ final class ShopSettingController { public function __construct( @@ -32,7 +35,7 @@ public function __construct( #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingInteger(string $name): IntegerSetting + public function shopSettingInteger(string $name): IntegerSetting { return $this->shopSettingService->getIntegerSetting($name); } @@ -41,7 +44,7 @@ public function getShopSettingInteger(string $name): IntegerSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingFloat(string $name): FloatSetting + public function shopSettingFloat(string $name): FloatSetting { return $this->shopSettingService->getFloatSetting($name); } @@ -50,7 +53,7 @@ public function getShopSettingFloat(string $name): FloatSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingBoolean(string $name): BooleanSetting + public function shopSettingBoolean(string $name): BooleanSetting { return $this->shopSettingService->getBooleanSetting($name); } @@ -59,7 +62,7 @@ public function getShopSettingBoolean(string $name): BooleanSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingString(string $name): StringSetting + public function shopSettingString(string $name): StringSetting { return $this->shopSettingService->getStringSetting($name); } @@ -68,7 +71,7 @@ public function getShopSettingString(string $name): StringSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingSelect(string $name): StringSetting + public function shopSettingSelect(string $name): StringSetting { return $this->shopSettingService->getSelectSetting($name); } @@ -77,7 +80,7 @@ public function getShopSettingSelect(string $name): StringSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingCollection(string $name): StringSetting + public function shopSettingCollection(string $name): StringSetting { return $this->shopSettingService->getCollectionSetting($name); } @@ -86,7 +89,7 @@ public function getShopSettingCollection(string $name): StringSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingAssocCollection(string $name): StringSetting + public function shopSettingAssocCollection(string $name): StringSetting { return $this->shopSettingService->getAssocCollectionSetting($name); } @@ -95,7 +98,7 @@ public function getShopSettingAssocCollection(string $name): StringSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeShopSettingInteger(string $name, int $value): IntegerSetting + public function shopSettingIntegerChange(string $name, int $value): IntegerSetting { return $this->shopSettingService->changeIntegerSetting($name, $value); } @@ -104,7 +107,7 @@ public function changeShopSettingInteger(string $name, int $value): IntegerSetti #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeShopSettingFloat(string $name, float $value): FloatSetting + public function shopSettingFloatChange(string $name, float $value): FloatSetting { return $this->shopSettingService->changeFloatSetting($name, $value); } @@ -113,7 +116,7 @@ public function changeShopSettingFloat(string $name, float $value): FloatSetting #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeShopSettingBoolean(string $name, bool $value): BooleanSetting + public function shopSettingBooleanChange(string $name, bool $value): BooleanSetting { return $this->shopSettingService->changeBooleanSetting($name, $value); } @@ -122,7 +125,7 @@ public function changeShopSettingBoolean(string $name, bool $value): BooleanSett #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeShopSettingString(string $name, string $value): StringSetting + public function shopSettingStringChange(string $name, string $value): StringSetting { return $this->shopSettingService->changeStringSetting($name, $value); } @@ -131,7 +134,7 @@ public function changeShopSettingString(string $name, string $value): StringSett #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeShopSettingSelect(string $name, string $value): StringSetting + public function shopSettingSelectChange(string $name, string $value): StringSetting { return $this->shopSettingService->changeSelectSetting($name, $value); } @@ -140,7 +143,7 @@ public function changeShopSettingSelect(string $name, string $value): StringSett #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeShopSettingCollection(string $name, string $value): StringSetting + public function shopSettingCollectionChange(string $name, string $value): StringSetting { return $this->shopSettingService->changeCollectionSetting($name, $value); } @@ -149,7 +152,7 @@ public function changeShopSettingCollection(string $name, string $value): String #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeShopSettingAssocCollection(string $name, string $value): StringSetting + public function shopSettingAssocCollectionChange(string $name, string $value): StringSetting { return $this->shopSettingService->changeAssocCollectionSetting($name, $value); } @@ -161,7 +164,7 @@ public function changeShopSettingAssocCollection(string $name, string $value): S #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getShopSettingsList(): array + public function shopSettings(): array { return $this->shopSettingService->getSettingsList(); } diff --git a/src/Theme/Controller/ThemeSettingController.php b/src/Theme/Controller/ThemeSettingController.php index bd590f3..c719bf8 100644 --- a/src/Theme/Controller/ThemeSettingController.php +++ b/src/Theme/Controller/ThemeSettingController.php @@ -21,6 +21,9 @@ use TheCodingMachine\GraphQLite\Annotations\Query; use TheCodingMachine\GraphQLite\Annotations\Right; +/** + * @SuppressWarnings(PHPMD.TooManyPublicMethods) + */ final class ThemeSettingController { public function __construct( @@ -32,7 +35,7 @@ public function __construct( #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingInteger(string $name, string $themeId): IntegerSetting + public function themeSettingInteger(string $name, string $themeId): IntegerSetting { return $this->themeSettingService->getIntegerSetting($name, $themeId); } @@ -41,7 +44,7 @@ public function getThemeSettingInteger(string $name, string $themeId): IntegerSe #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingFloat(string $name, string $themeId): FloatSetting + public function themeSettingFloat(string $name, string $themeId): FloatSetting { return $this->themeSettingService->getFloatSetting($name, $themeId); } @@ -50,7 +53,7 @@ public function getThemeSettingFloat(string $name, string $themeId): FloatSettin #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingBoolean(string $name, string $themeId): BooleanSetting + public function themeSettingBoolean(string $name, string $themeId): BooleanSetting { return $this->themeSettingService->getBooleanSetting($name, $themeId); } @@ -59,7 +62,7 @@ public function getThemeSettingBoolean(string $name, string $themeId): BooleanSe #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingString(string $name, string $themeId): StringSetting + public function themeSettingString(string $name, string $themeId): StringSetting { return $this->themeSettingService->getStringSetting($name, $themeId); } @@ -68,7 +71,7 @@ public function getThemeSettingString(string $name, string $themeId): StringSett #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingSelect(string $name, string $themeId): StringSetting + public function themeSettingSelect(string $name, string $themeId): StringSetting { return $this->themeSettingService->getSelectSetting($name, $themeId); } @@ -77,7 +80,7 @@ public function getThemeSettingSelect(string $name, string $themeId): StringSett #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingCollection(string $name, string $themeId): StringSetting + public function themeSettingCollection(string $name, string $themeId): StringSetting { return $this->themeSettingService->getCollectionSetting($name, $themeId); } @@ -86,7 +89,7 @@ public function getThemeSettingCollection(string $name, string $themeId): String #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingAssocCollection(string $name, string $themeId): StringSetting + public function themeSettingAssocCollection(string $name, string $themeId): StringSetting { return $this->themeSettingService->getAssocCollectionSetting($name, $themeId); } @@ -98,7 +101,7 @@ public function getThemeSettingAssocCollection(string $name, string $themeId): S #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function getThemeSettingsList(string $themeId): array + public function themeSettings(string $themeId): array { return $this->themeSettingService->getSettingsList($themeId); } @@ -107,7 +110,7 @@ public function getThemeSettingsList(string $themeId): array #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeThemeSettingInteger(string $name, int $value, string $themeId): IntegerSetting + public function themeSettingIntegerChange(string $name, int $value, string $themeId): IntegerSetting { return $this->themeSettingService->changeIntegerSetting($name, $value, $themeId); } @@ -116,7 +119,7 @@ public function changeThemeSettingInteger(string $name, int $value, string $them #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeThemeSettingFloat(string $name, float $value, string $themeId): FloatSetting + public function themeSettingFloatChange(string $name, float $value, string $themeId): FloatSetting { return $this->themeSettingService->changeFloatSetting($name, $value, $themeId); } @@ -125,7 +128,7 @@ public function changeThemeSettingFloat(string $name, float $value, string $them #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeThemeSettingBoolean(string $name, bool $value, string $themeId): BooleanSetting + public function themeSettingBooleanChange(string $name, bool $value, string $themeId): BooleanSetting { return $this->themeSettingService->changeBooleanSetting($name, $value, $themeId); } @@ -134,7 +137,7 @@ public function changeThemeSettingBoolean(string $name, bool $value, string $the #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeThemeSettingString(string $name, string $value, string $themeId): StringSetting + public function themeSettingStringChange(string $name, string $value, string $themeId): StringSetting { return $this->themeSettingService->changeStringSetting($name, $value, $themeId); } @@ -143,7 +146,7 @@ public function changeThemeSettingString(string $name, string $value, string $th #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeThemeSettingSelect(string $name, string $value, string $themeId): StringSetting + public function themeSettingSelectChange(string $name, string $value, string $themeId): StringSetting { return $this->themeSettingService->changeSelectSetting($name, $value, $themeId); } @@ -152,7 +155,7 @@ public function changeThemeSettingSelect(string $name, string $value, string $th #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeThemeSettingCollection(string $name, string $value, string $themeId): StringSetting + public function themeSettingCollectionChange(string $name, string $value, string $themeId): StringSetting { return $this->themeSettingService->changeCollectionSetting($name, $value, $themeId); } @@ -161,7 +164,7 @@ public function changeThemeSettingCollection(string $name, string $value, string #[Logged] #[HideIfUnauthorized] #[Right('CHANGE_CONFIGURATION')] - public function changeThemeSettingAssocCollection(string $name, string $value, string $themeId): StringSetting + public function themeSettingAssocCollectionChange(string $name, string $value, string $themeId): StringSetting { return $this->themeSettingService->changeAssocCollectionSetting($name, $value, $themeId); } diff --git a/tests/Codeception/Acceptance/Module/ModuleSettingListCest.php b/tests/Codeception/Acceptance/Module/ModuleSettingListCest.php index 65348ab..8124131 100644 --- a/tests/Codeception/Acceptance/Module/ModuleSettingListCest.php +++ b/tests/Codeception/Acceptance/Module/ModuleSettingListCest.php @@ -19,13 +19,13 @@ */ final class ModuleSettingListCest extends ModuleSettingBaseCest { - public function testGetModuleSettingsListAuthorized(AcceptanceTester $I): void + public function testGetModuleSettingsAuthorized(AcceptanceTester $I): void { $I->login($this->getAdminUsername(), $this->getAdminPassword()); $I->sendGQLQuery( 'query getSettings($moduleId: String!){ - moduleSettingsList(moduleId: $moduleId) { + moduleSettings(moduleId: $moduleId) { name type supported @@ -39,7 +39,7 @@ public function testGetModuleSettingsListAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $settingsList = $result['data']['moduleSettingsList']; + $settingsList = $result['data']['moduleSettings']; $I->assertCount(5, $settingsList); $I->assertContains( ['name' => 'intSetting', 'type' => FieldType::NUMBER, 'supported' => true], diff --git a/tests/Codeception/Acceptance/Module/ModuleSettingMutationsCest.php b/tests/Codeception/Acceptance/Module/ModuleSettingMutationsCest.php index 9f46a56..fc21eee 100644 --- a/tests/Codeception/Acceptance/Module/ModuleSettingMutationsCest.php +++ b/tests/Codeception/Acceptance/Module/ModuleSettingMutationsCest.php @@ -24,7 +24,7 @@ public function testChangeIntegerSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: Int!, $moduleId: String!){ - changeModuleSettingInteger(name: $name, value: $value, moduleId: $moduleId) { + moduleSettingIntegerChange(name: $name, value: $value, moduleId: $moduleId) { name value } @@ -42,7 +42,7 @@ public function testChangeIntegerSettingAuthorized(AcceptanceTester $I): void $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeModuleSettingInteger']; + $setting = $result['data']['moduleSettingIntegerChange']; $I->assertSame('intSetting', $setting['name']); $I->assertSame(124, $setting['value']); } @@ -53,7 +53,7 @@ public function testChangeFloatSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: Float!, $moduleId: String!){ - changeModuleSettingFloat(name: $name, value: $value, moduleId: $moduleId) { + moduleSettingFloatChange(name: $name, value: $value, moduleId: $moduleId) { name value } @@ -71,7 +71,7 @@ public function testChangeFloatSettingAuthorized(AcceptanceTester $I): void $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeModuleSettingFloat']; + $setting = $result['data']['moduleSettingFloatChange']; $I->assertSame('floatSetting', $setting['name']); $I->assertSame(1.24, $setting['value']); } @@ -82,7 +82,7 @@ public function testChangeBooleanSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: Boolean!, $moduleId: String!){ - changeModuleSettingBoolean(name: $name, value: $value, moduleId: $moduleId) { + moduleSettingBooleanChange(name: $name, value: $value, moduleId: $moduleId) { name value } @@ -100,7 +100,7 @@ public function testChangeBooleanSettingAuthorized(AcceptanceTester $I): void $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeModuleSettingBoolean']; + $setting = $result['data']['moduleSettingBooleanChange']; $I->assertSame('boolSetting', $setting['name']); $I->assertSame(false, $setting['value']); } @@ -111,7 +111,7 @@ public function testChangeStringSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: String!, $moduleId: String!){ - changeModuleSettingString(name: $name, value: $value, moduleId: $moduleId) { + moduleSettingStringChange(name: $name, value: $value, moduleId: $moduleId) { name value } @@ -129,7 +129,7 @@ public function testChangeStringSettingAuthorized(AcceptanceTester $I): void $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeModuleSettingString']; + $setting = $result['data']['moduleSettingStringChange']; $I->assertSame('stringSetting', $setting['name']); $I->assertSame('default', $setting['value']); } @@ -140,7 +140,7 @@ public function testChangeCollectionSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: String!, $moduleId: String!){ - changeModuleSettingCollection(name: $name, value: $value, moduleId: $moduleId) { + moduleSettingCollectionChange(name: $name, value: $value, moduleId: $moduleId) { name value } @@ -158,7 +158,7 @@ public function testChangeCollectionSettingAuthorized(AcceptanceTester $I): void $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeModuleSettingCollection']; + $setting = $result['data']['moduleSettingCollectionChange']; $I->assertSame('arraySetting', $setting['name']); $I->assertSame('[3,"interesting","values"]', $setting['value']); } diff --git a/tests/Codeception/Acceptance/NotAuthorizedAccessCest.php b/tests/Codeception/Acceptance/NotAuthorizedAccessCest.php index b16ab08..7fe388a 100644 --- a/tests/Codeception/Acceptance/NotAuthorizedAccessCest.php +++ b/tests/Codeception/Acceptance/NotAuthorizedAccessCest.php @@ -53,20 +53,20 @@ protected function themeGettersDataProvider(): \Generator protected function themeMutationsDataProvider(): \Generator { - yield ['queryType' => 'mutation', 'queryName' => 'changeThemeSettingInteger', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeThemeSettingFloat', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeThemeSettingBoolean', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeThemeSettingString', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeThemeSettingSelect', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeThemeSettingCollection', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeThemeSettingAssocCollection', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'themeSettingIntegerChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'themeSettingFloatChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'themeSettingBooleanChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'themeSettingStringChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'themeSettingSelectChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'themeSettingCollectionChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'themeSettingAssocCollectionChange', 'field' => 'name']; } protected function listQueriesDataProvider(): \Generator { - yield ['queryType' => 'query', 'queryName' => 'themeSettingsList', 'field' => 'name']; - yield ['queryType' => 'query', 'queryName' => 'moduleSettingsList', 'field' => 'name']; - yield ['queryType' => 'query', 'queryName' => 'shopSettingsList', 'field' => 'name']; + yield ['queryType' => 'query', 'queryName' => 'themeSettings', 'field' => 'name']; + yield ['queryType' => 'query', 'queryName' => 'moduleSettings', 'field' => 'name']; + yield ['queryType' => 'query', 'queryName' => 'shopSettings', 'field' => 'name']; } protected function moduleGettersDataProvider(): \Generator @@ -80,11 +80,11 @@ protected function moduleGettersDataProvider(): \Generator protected function moduleMutationsDataProvider(): \Generator { - yield ['queryType' => 'mutation', 'queryName' => 'changeModuleSettingInteger', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeModuleSettingFloat', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeModuleSettingBoolean', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeModuleSettingString', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeModuleSettingCollection', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'moduleSettingIntegerChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'moduleSettingFloatChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'moduleSettingBooleanChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'moduleSettingStringString', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'moduleSettingCollectionChange', 'field' => 'name']; } protected function shopGettersDataProvider(): \Generator @@ -100,13 +100,13 @@ protected function shopGettersDataProvider(): \Generator protected function shopMutationsDataProvider(): \Generator { - yield ['queryType' => 'mutation', 'queryName' => 'changeShopSettingInteger', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeShopSettingFloat', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeShopSettingBoolean', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeShopSettingString', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeShopSettingSelect', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeShopSettingCollection', 'field' => 'name']; - yield ['queryType' => 'mutation', 'queryName' => 'changeShopSettingAssocCollection', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'shopSettingIntegerChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'shopSettingFloatChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'shopSettingBooleanChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'shopSettingStringChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'shopSettingSelectChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'shopSettingCollectionChange', 'field' => 'name']; + yield ['queryType' => 'mutation', 'queryName' => 'shopSettingAssocCollectionChange', 'field' => 'name']; } private function runSimplifiedAccessCheckQuery( diff --git a/tests/Codeception/Acceptance/Shop/ShopSettingListCest.php b/tests/Codeception/Acceptance/Shop/ShopSettingListCest.php index 638da5e..6473962 100644 --- a/tests/Codeception/Acceptance/Shop/ShopSettingListCest.php +++ b/tests/Codeception/Acceptance/Shop/ShopSettingListCest.php @@ -20,13 +20,13 @@ */ final class ShopSettingListCest extends BaseCest { - public function testGetShopSettingsListAuthorized(AcceptanceTester $I): void + public function testGetShopSettingsAuthorized(AcceptanceTester $I): void { $I->login($this->getAdminUsername(), $this->getAdminPassword()); $I->sendGQLQuery( 'query{ - shopSettingsList { + shopSettings { name type supported @@ -39,7 +39,7 @@ public function testGetShopSettingsListAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $settingsList = $result['data']['shopSettingsList']; + $settingsList = $result['data']['shopSettings']; $I->assertContains( ['name' => 'intSetting', 'type' => FieldType::NUMBER, 'supported' => true], $settingsList diff --git a/tests/Codeception/Acceptance/Shop/ShopSettingMutationsCest.php b/tests/Codeception/Acceptance/Shop/ShopSettingMutationsCest.php index 3e6221e..92d769e 100644 --- a/tests/Codeception/Acceptance/Shop/ShopSettingMutationsCest.php +++ b/tests/Codeception/Acceptance/Shop/ShopSettingMutationsCest.php @@ -52,49 +52,49 @@ public function testChangeSettingAuthorized(AcceptanceTester $I, \Codeception\Ex protected function mutationMethodsDataProvider(): \Generator { yield [ - 'mutationName' => 'changeShopSettingInteger', + 'mutationName' => 'shopSettingIntegerChange', 'settingName' => 'intSetting', 'settingValue' => 235, 'valueType' => 'Int!' ]; yield [ - 'mutationName' => 'changeShopSettingFloat', + 'mutationName' => 'shopSettingFloatChange', 'settingName' => 'floatSetting', 'settingValue' => 2.35, 'valueType' => 'Float!' ]; yield [ - 'mutationName' => 'changeShopSettingBoolean', + 'mutationName' => 'shopSettingBooleanChange', 'settingName' => 'boolSetting', 'settingValue' => true, 'valueType' => 'Boolean!' ]; yield [ - 'mutationName' => 'changeShopSettingString', + 'mutationName' => 'shopSettingStringChange', 'settingName' => 'stringSetting', 'settingValue' => 'some string value', 'valueType' => 'String!' ]; yield [ - 'mutationName' => 'changeShopSettingSelect', + 'mutationName' => 'shopSettingSelectChange', 'settingName' => 'selectSetting', 'settingValue' => 'some select value', 'valueType' => 'String!' ]; yield [ - 'mutationName' => 'changeShopSettingCollection', + 'mutationName' => 'shopSettingCollectionChange', 'settingName' => 'arraySetting', 'settingValue' => '["10","20","50","100"]', 'valueType' => 'String!' ]; yield [ - 'mutationName' => 'changeShopSettingAssocCollection', + 'mutationName' => 'shopSettingAssocCollectionChange', 'settingName' => 'aarraySetting', 'settingValue' => '{"first":"10","second":"20","third":"50"}', 'valueType' => 'String!' diff --git a/tests/Codeception/Acceptance/Theme/ThemeSettingListCest.php b/tests/Codeception/Acceptance/Theme/ThemeSettingListCest.php index 18787ba..5fcab83 100644 --- a/tests/Codeception/Acceptance/Theme/ThemeSettingListCest.php +++ b/tests/Codeception/Acceptance/Theme/ThemeSettingListCest.php @@ -20,12 +20,12 @@ */ final class ThemeSettingListCest extends BaseCest { - public function testGetThemeSettingsListAuthorized(AcceptanceTester $I): void + public function testGetThemeSettingsAuthorized(AcceptanceTester $I): void { $I->login($this->getAdminUsername(), $this->getAdminPassword()); $I->sendGQLQuery( 'query getSettings($themeId: String!){ - themeSettingsList(themeId: $themeId) { + themeSettings(themeId: $themeId) { name type supported @@ -36,7 +36,7 @@ public function testGetThemeSettingsListAuthorized(AcceptanceTester $I): void $I->seeResponseIsJson(); $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $settingsList = $result['data']['themeSettingsList']; + $settingsList = $result['data']['themeSettings']; $I->assertCount(14, $settingsList); $I->assertContains( ['name' => 'intSetting', 'type' => FieldType::NUMBER, 'supported' => true], diff --git a/tests/Codeception/Acceptance/Theme/ThemeSettingMutationsCest.php b/tests/Codeception/Acceptance/Theme/ThemeSettingMutationsCest.php index 5eb03fd..cd19f31 100644 --- a/tests/Codeception/Acceptance/Theme/ThemeSettingMutationsCest.php +++ b/tests/Codeception/Acceptance/Theme/ThemeSettingMutationsCest.php @@ -25,7 +25,7 @@ public function testChangeIntegerSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: Int!, $themeId: String!){ - changeThemeSettingInteger(name: $name, value: $value, themeId: $themeId) { + themeSettingIntegerChange(name: $name, value: $value, themeId: $themeId) { name value } @@ -42,7 +42,7 @@ public function testChangeIntegerSettingAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeThemeSettingInteger']; + $setting = $result['data']['themeSettingIntegerChange']; $I->assertSame('intSettingEditable', $setting['name']); $I->assertSame(124, $setting['value']); } @@ -53,7 +53,7 @@ public function testChangeFloatSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: Float!, $themeId: String!){ - changeThemeSettingFloat(name: $name, value: $value, themeId: $themeId) { + themeSettingFloatChange(name: $name, value: $value, themeId: $themeId) { name value } @@ -70,7 +70,7 @@ public function testChangeFloatSettingAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeThemeSettingFloat']; + $setting = $result['data']['themeSettingFloatChange']; $I->assertSame('floatSettingEditable', $setting['name']); $I->assertSame(1.24, $setting['value']); } @@ -81,7 +81,7 @@ public function testChangeBooleanSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: Boolean!, $themeId: String!){ - changeThemeSettingBoolean(name: $name, value: $value, themeId: $themeId) { + themeSettingBooleanChange(name: $name, value: $value, themeId: $themeId) { name value } @@ -98,7 +98,7 @@ public function testChangeBooleanSettingAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeThemeSettingBoolean']; + $setting = $result['data']['themeSettingBooleanChange']; $I->assertSame('boolSettingEditable', $setting['name']); $I->assertSame(true, $setting['value']); } @@ -109,7 +109,7 @@ public function testChangeStringSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: String!, $themeId: String!){ - changeThemeSettingString(name: $name, value: $value, themeId: $themeId) { + themeSettingStringChange(name: $name, value: $value, themeId: $themeId) { name value } @@ -126,7 +126,7 @@ public function testChangeStringSettingAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeThemeSettingString']; + $setting = $result['data']['themeSettingStringChange']; $I->assertSame('stringSettingEditable', $setting['name']); $I->assertSame('default', $setting['value']); } @@ -137,7 +137,7 @@ public function testChangeSelectSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: String!, $themeId: String!){ - changeThemeSettingSelect(name: $name, value: $value, themeId: $themeId) { + themeSettingSelectChange(name: $name, value: $value, themeId: $themeId) { name value } @@ -154,7 +154,7 @@ public function testChangeSelectSettingAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeThemeSettingSelect']; + $setting = $result['data']['themeSettingSelectChange']; $I->assertSame('selectSettingEditable', $setting['name']); $I->assertSame('new select', $setting['value']); } @@ -165,7 +165,7 @@ public function testChangeCollectionSettingAuthorized(AcceptanceTester $I): void $I->sendGQLQuery( 'mutation m($name: String!, $value: String!, $themeId: String!){ - changeThemeSettingCollection(name: $name, value: $value, themeId: $themeId) { + themeSettingCollectionChange(name: $name, value: $value, themeId: $themeId) { name value } @@ -182,7 +182,7 @@ public function testChangeCollectionSettingAuthorized(AcceptanceTester $I): void $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeThemeSettingCollection']; + $setting = $result['data']['themeSettingCollectionChange']; $I->assertSame('arraySettingEditable', $setting['name']); $I->assertSame('[3,"interesting","values"]', $setting['value']); } @@ -193,7 +193,7 @@ public function testChangeAssocCollectionSettingAuthorized(AcceptanceTester $I): $I->sendGQLQuery( 'mutation m($name: String!, $value: String!, $themeId: String!){ - changeThemeSettingAssocCollection(name: $name, value: $value, themeId: $themeId) { + themeSettingAssocCollectionChange(name: $name, value: $value, themeId: $themeId) { name value } @@ -210,7 +210,7 @@ public function testChangeAssocCollectionSettingAuthorized(AcceptanceTester $I): $result = $I->grabJsonResponseAsArray(); $I->assertArrayNotHasKey('errors', $result); - $setting = $result['data']['changeThemeSettingAssocCollection']; + $setting = $result['data']['themeSettingAssocCollectionChange']; $I->assertSame('assocArraySettingEditable', $setting['name']); $I->assertSame('{"first":"10","second":"20","third":"50"}', $setting['value']); } diff --git a/tests/Unit/Module/Controller/ModuleSettingControllerTest.php b/tests/Unit/Module/Controller/ModuleSettingControllerTest.php index 3a2a2b9..fb0e56c 100644 --- a/tests/Unit/Module/Controller/ModuleSettingControllerTest.php +++ b/tests/Unit/Module/Controller/ModuleSettingControllerTest.php @@ -44,84 +44,84 @@ public function proxyTestDataProvider(): \Generator $settingName = 'settingName'; yield 'getter integer' => [ - 'controllerMethod' => 'getModuleSettingInteger', + 'controllerMethod' => 'moduleSettingInteger', 'serviceMethod' => 'getIntegerSetting', 'params' => [$settingName, 'awesomeModule'], 'expectedValue' => new IntegerSetting($settingName, 123) ]; yield 'getter float' => [ - 'controllerMethod' => 'getModuleSettingFloat', + 'controllerMethod' => 'moduleSettingFloat', 'serviceMethod' => 'getFloatSetting', 'params' => [$settingName, 'awesomeModule'], 'expectedValue' => new FloatSetting($settingName, 1.23) ]; yield 'getter bool' => [ - 'controllerMethod' => 'getModuleSettingBoolean', + 'controllerMethod' => 'moduleSettingBoolean', 'serviceMethod' => 'getBooleanSetting', 'params' => [$settingName, 'awesomeModule'], 'expectedValue' => new BooleanSetting($settingName, false) ]; yield 'getter string' => [ - 'controllerMethod' => 'getModuleSettingString', + 'controllerMethod' => 'moduleSettingString', 'serviceMethod' => 'getStringSetting', 'params' => [$settingName, 'awesomeModule'], 'expectedValue' => new StringSetting($settingName, 'default') ]; yield 'getter collection' => [ - 'controllerMethod' => 'getModuleSettingCollection', + 'controllerMethod' => 'moduleSettingCollection', 'serviceMethod' => 'getCollectionSetting', 'params' => [$settingName, 'awesomeModule'], 'expectedValue' => new StringSetting($settingName, 'someCollectionStringExample') ]; yield 'setter integer' => [ - 'controllerMethod' => 'changeModuleSettingInteger', + 'controllerMethod' => 'moduleSettingIntegerChange', 'serviceMethod' => 'changeIntegerSetting', 'params' => [$settingName, 123, 'awesomeModule'], 'expectedValue' => new IntegerSetting($settingName, 123) ]; yield 'setter float' => [ - 'controllerMethod' => 'changeModuleSettingFloat', + 'controllerMethod' => 'moduleSettingFloatChange', 'serviceMethod' => 'changeFloatSetting', 'params' => [$settingName, 1.23, 'awesomeModule'], 'expectedValue' => new FloatSetting($settingName, 1.23) ]; yield 'setter float with integer value' => [ - 'controllerMethod' => 'changeModuleSettingFloat', + 'controllerMethod' => 'moduleSettingFloatChange', 'serviceMethod' => 'changeFloatSetting', 'params' => [$settingName, 123, 'awesomeModule'], 'expectedValue' => new FloatSetting($settingName, 123) ]; yield 'setter boolean' => [ - 'controllerMethod' => 'changeModuleSettingBoolean', + 'controllerMethod' => 'moduleSettingBooleanChange', 'serviceMethod' => 'changeBooleanSetting', 'params' => [$settingName, false, 'awesomeModule'], 'expectedValue' => new BooleanSetting($settingName, false) ]; yield 'setter string' => [ - 'controllerMethod' => 'changeModuleSettingString', + 'controllerMethod' => 'moduleSettingStringChange', 'serviceMethod' => 'changeStringSetting', 'params' => [$settingName, 'some string', 'awesomeModule'], 'expectedValue' => new StringSetting($settingName, 'some string') ]; yield 'setter collection' => [ - 'controllerMethod' => 'changeModuleSettingCollection', + 'controllerMethod' => 'moduleSettingCollectionChange', 'serviceMethod' => 'changeCollectionSetting', 'params' => [$settingName, 'some collection string', 'awesomeModule'], 'expectedValue' => new StringSetting($settingName, 'some collection string') ]; yield 'list query' => [ - 'controllerMethod' => 'getModuleSettingsList', + 'controllerMethod' => 'moduleSettings', 'serviceMethod' => 'getSettingsList', 'params' => ['awesomeModule'], 'expectedValue' => [ diff --git a/tests/Unit/Shop/Controller/ShopSettingControllerTest.php b/tests/Unit/Shop/Controller/ShopSettingControllerTest.php index 7895644..56ef2b7 100644 --- a/tests/Unit/Shop/Controller/ShopSettingControllerTest.php +++ b/tests/Unit/Shop/Controller/ShopSettingControllerTest.php @@ -44,112 +44,112 @@ public function proxyTestDataProvider(): \Generator $settingName = 'settingName'; yield 'getter integer' => [ - 'controllerMethod' => 'getShopSettingInteger', + 'controllerMethod' => 'shopSettingInteger', 'serviceMethod' => 'getIntegerSetting', 'params' => [$settingName], 'expectedValue' => new IntegerSetting($settingName, 123) ]; yield 'getter float' => [ - 'controllerMethod' => 'getShopSettingFloat', + 'controllerMethod' => 'shopSettingFloat', 'serviceMethod' => 'getFloatSetting', 'params' => [$settingName], 'expectedValue' => new FloatSetting($settingName, 1.23) ]; yield 'getter bool' => [ - 'controllerMethod' => 'getShopSettingBoolean', + 'controllerMethod' => 'shopSettingBoolean', 'serviceMethod' => 'getBooleanSetting', 'params' => [$settingName], 'expectedValue' => new BooleanSetting($settingName, false) ]; yield 'getter string' => [ - 'controllerMethod' => 'getShopSettingString', + 'controllerMethod' => 'shopSettingString', 'serviceMethod' => 'getStringSetting', 'params' => [$settingName], 'expectedValue' => new StringSetting($settingName, 'default') ]; yield 'getter select' => [ - 'controllerMethod' => 'getShopSettingSelect', + 'controllerMethod' => 'shopSettingSelect', 'serviceMethod' => 'getSelectSetting', 'params' => [$settingName], 'expectedValue' => new StringSetting($settingName, 'some select setting value') ]; yield 'getter collection' => [ - 'controllerMethod' => 'getShopSettingCollection', + 'controllerMethod' => 'shopSettingCollection', 'serviceMethod' => 'getCollectionSetting', 'params' => [$settingName], 'expectedValue' => new StringSetting($settingName, 'some collection string example') ]; yield 'getter associative collection' => [ - 'controllerMethod' => 'getShopSettingAssocCollection', + 'controllerMethod' => 'shopSettingAssocCollection', 'serviceMethod' => 'getAssocCollectionSetting', 'params' => [$settingName], 'expectedValue' => new StringSetting($settingName, 'some associative collection string example') ]; yield 'setter integer' => [ - 'controllerMethod' => 'changeShopSettingInteger', + 'controllerMethod' => 'shopSettingIntegerChange', 'serviceMethod' => 'changeIntegerSetting', 'params' => [$settingName, 123], 'expectedValue' => new IntegerSetting($settingName, 123) ]; yield 'setter float' => [ - 'controllerMethod' => 'changeShopSettingFloat', + 'controllerMethod' => 'shopSettingFloatChange', 'serviceMethod' => 'changeFloatSetting', 'params' => [$settingName, 1.23], 'expectedValue' => new FloatSetting($settingName, 1.23) ]; yield 'setter float with integer value' => [ - 'controllerMethod' => 'changeShopSettingFloat', + 'controllerMethod' => 'shopSettingFloatChange', 'serviceMethod' => 'changeFloatSetting', 'params' => [$settingName, 123], 'expectedValue' => new FloatSetting($settingName, 123) ]; yield 'setter boolean' => [ - 'controllerMethod' => 'changeShopSettingBoolean', + 'controllerMethod' => 'shopSettingBooleanChange', 'serviceMethod' => 'changeBooleanSetting', 'params' => [$settingName, false], 'expectedValue' => new BooleanSetting($settingName, false) ]; yield 'setter string' => [ - 'controllerMethod' => 'changeShopSettingString', + 'controllerMethod' => 'shopSettingStringChange', 'serviceMethod' => 'changeStringSetting', 'params' => [$settingName, 'some string'], 'expectedValue' => new StringSetting($settingName, 'some string') ]; yield 'setter select' => [ - 'controllerMethod' => 'changeShopSettingSelect', + 'controllerMethod' => 'shopSettingSelectChange', 'serviceMethod' => 'changeSelectSetting', 'params' => [$settingName, 'some select value'], 'expectedValue' => new StringSetting($settingName, 'some select value') ]; yield 'setter collection' => [ - 'controllerMethod' => 'changeShopSettingCollection', + 'controllerMethod' => 'shopSettingCollectionChange', 'serviceMethod' => 'changeCollectionSetting', 'params' => [$settingName, 'some collection string'], 'expectedValue' => new StringSetting($settingName, 'some collection string') ]; yield 'setter assoc collection' => [ - 'controllerMethod' => 'changeShopSettingAssocCollection', + 'controllerMethod' => 'shopSettingAssocCollectionChange', 'serviceMethod' => 'changeAssocCollectionSetting', 'params' => [$settingName, 'some assoc collection string'], 'expectedValue' => new StringSetting($settingName, 'some assoc collection string') ]; yield 'setting list getter' => [ - 'controllerMethod' => 'getShopSettingsList', + 'controllerMethod' => 'shopSettings', 'serviceMethod' => 'getSettingsList', 'params' => [], 'expectedValue' => [ diff --git a/tests/Unit/Theme/Controller/ThemeSettingControllerTest.php b/tests/Unit/Theme/Controller/ThemeSettingControllerTest.php index 3357307..ead5a61 100644 --- a/tests/Unit/Theme/Controller/ThemeSettingControllerTest.php +++ b/tests/Unit/Theme/Controller/ThemeSettingControllerTest.php @@ -44,112 +44,112 @@ public function proxyTestDataProvider(): \Generator $name = 'settingName'; yield 'getter integer' => [ - 'controllerMethod' => 'getThemeSettingInteger', + 'controllerMethod' => 'themeSettingInteger', 'serviceMethod' => 'getIntegerSetting', 'params' => [$name, 'awesomeTheme'], 'expectedValue' => new IntegerSetting($name, 123) ]; yield 'getter float' => [ - 'controllerMethod' => 'getThemeSettingFloat', + 'controllerMethod' => 'themeSettingFloat', 'serviceMethod' => 'getFloatSetting', 'params' => [$name, 'awesomeTheme'], 'expectedValue' => new FloatSetting($name, 1.23) ]; yield 'getter bool' => [ - 'controllerMethod' => 'getThemeSettingBoolean', + 'controllerMethod' => 'themeSettingBoolean', 'serviceMethod' => 'getBooleanSetting', 'params' => [$name, 'awesomeTheme'], 'expectedValue' => new BooleanSetting($name, false) ]; yield 'getter string' => [ - 'controllerMethod' => 'getThemeSettingString', + 'controllerMethod' => 'themeSettingString', 'serviceMethod' => 'getStringSetting', 'params' => [$name, 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'default') ]; yield 'getter select' => [ - 'controllerMethod' => 'getThemeSettingSelect', + 'controllerMethod' => 'themeSettingSelect', 'serviceMethod' => 'getSelectSetting', 'params' => [$name, 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'some select setting value') ]; yield 'getter collection' => [ - 'controllerMethod' => 'getThemeSettingCollection', + 'controllerMethod' => 'themeSettingCollection', 'serviceMethod' => 'getCollectionSetting', 'params' => [$name, 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'someCollectionStringExample') ]; yield 'getter associative collection' => [ - 'controllerMethod' => 'getThemeSettingAssocCollection', + 'controllerMethod' => 'themeSettingAssocCollection', 'serviceMethod' => 'getAssocCollectionSetting', 'params' => [$name, 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'some associative collection string example') ]; yield 'setter integer' => [ - 'controllerMethod' => 'changeThemeSettingInteger', + 'controllerMethod' => 'themeSettingIntegerChange', 'serviceMethod' => 'changeIntegerSetting', 'params' => [$name, 123, 'awesomeTheme'], 'expectedValue' => new IntegerSetting($name, 123) ]; yield 'setter float' => [ - 'controllerMethod' => 'changeThemeSettingFloat', + 'controllerMethod' => 'themeSettingFloatChange', 'serviceMethod' => 'changeFloatSetting', 'params' => [$name, 1.23, 'awesomeTheme'], 'expectedValue' => new FloatSetting($name, 1.23) ]; yield 'setter float with integer value' => [ - 'controllerMethod' => 'changeThemeSettingFloat', + 'controllerMethod' => 'themeSettingFloatChange', 'serviceMethod' => 'changeFloatSetting', 'params' => [$name, 123, 'awesomeTheme'], 'expectedValue' => new FloatSetting($name, 123) ]; yield 'setter boolean' => [ - 'controllerMethod' => 'changeThemeSettingBoolean', + 'controllerMethod' => 'themeSettingBooleanChange', 'serviceMethod' => 'changeBooleanSetting', 'params' => [$name, false, 'awesomeTheme'], 'expectedValue' => new BooleanSetting($name, false) ]; yield 'setter string' => [ - 'controllerMethod' => 'changeThemeSettingString', + 'controllerMethod' => 'themeSettingStringChange', 'serviceMethod' => 'changeStringSetting', 'params' => [$name, 'some string', 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'some string') ]; yield 'setter select' => [ - 'controllerMethod' => 'changeThemeSettingSelect', + 'controllerMethod' => 'themeSettingSelectChange', 'serviceMethod' => 'changeSelectSetting', 'params' => [$name, 'some string', 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'some string') ]; yield 'setter collection' => [ - 'controllerMethod' => 'changeThemeSettingCollection', + 'controllerMethod' => 'themeSettingCollectionChange', 'serviceMethod' => 'changeCollectionSetting', 'params' => [$name, 'some collection string', 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'some collection string') ]; yield 'setter assoc collection' => [ - 'controllerMethod' => 'changeThemeSettingAssocCollection', + 'controllerMethod' => 'themeSettingAssocCollectionChange', 'serviceMethod' => 'changeAssocCollectionSetting', 'params' => [$name, 'some assoc collection string', 'awesomeTheme'], 'expectedValue' => new StringSetting($name, 'some assoc collection string') ]; yield 'list query' => [ - 'controllerMethod' => 'getThemeSettingsList', + 'controllerMethod' => 'themeSettings', 'serviceMethod' => 'getSettingsList', 'params' => ['awesomeTheme'], 'expectedValue' => [