diff --git a/CHANGELOG.md b/CHANGELOG.md index 0da7bd5..4bb48ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Move ModuleDataType generation to Infrastructure - Move ThemeDataType generation to Infrastructure +### Removed +- `OxidEsales\GraphQL\ConfigurationAccess\Shared\Subscriber\BeforeModuleDeactivation` because de/activation is already handled by shop + ## [1.2.0] - 2024-11-27 This is the stable release of v1.2.0. No changes have been made since v1.2.0-rc.1. diff --git a/services.yaml b/services.yaml index b977260..0ffad21 100644 --- a/services.yaml +++ b/services.yaml @@ -4,9 +4,6 @@ imports: - { resource: src/Shop/services.yaml } - { resource: src/Theme/services.yaml } -parameters: - oxidesales.graphqlconfigurationaccess.depends_on_modules: [ 'oe_graphql_base' ] - services: _defaults: @@ -24,10 +21,3 @@ services: OxidEsales\GraphQL\ConfigurationAccess\DependencyCheckTrigger: alias: OxidEsales\GraphQL\Base\Framework\GraphQLQueryHandler public: true - - OxidEsales\GraphQL\ConfigurationAccess\Shared\Subscriber\BeforeModuleDeactivation: - class: OxidEsales\GraphQL\ConfigurationAccess\Shared\Subscriber\BeforeModuleDeactivation - arguments: - $dependencies: '%oxidesales.graphqlconfigurationaccess.depends_on_modules%' - tags: [ 'kernel.event_subscriber' ] - public: true diff --git a/src/Shared/Subscriber/BeforeModuleDeactivation.php b/src/Shared/Subscriber/BeforeModuleDeactivation.php deleted file mode 100644 index 1ccfd1c..0000000 --- a/src/Shared/Subscriber/BeforeModuleDeactivation.php +++ /dev/null @@ -1,45 +0,0 @@ -getModuleId(), $this->dependencies)) { - throw new ModuleSetupValidationException( - 'Module with id "' . $event->getModuleId() . - '" cannot be deactivated while GraphQL Configuration Access module is active.' - ); - } - - return $event; - } - - public static function getSubscribedEvents() - { - return [ - BeforeModuleDeactivationEvent::class => 'handle', - ]; - } -} diff --git a/tests/Unit/Shared/Subscriber/BeforeModuleDeactivationTest.php b/tests/Unit/Shared/Subscriber/BeforeModuleDeactivationTest.php deleted file mode 100644 index 22ae8d6..0000000 --- a/tests/Unit/Shared/Subscriber/BeforeModuleDeactivationTest.php +++ /dev/null @@ -1,57 +0,0 @@ -createConfiguredStub(BeforeModuleDeactivationEvent::class, [ - 'getModuleId' => uniqid('module') - ]); - - $sut = new BeforeModuleDeactivation($dependencies); - $returnEvent = $sut->handle($beforeModuleDeactivationEvent); - $this->assertSame($beforeModuleDeactivationEvent, $returnEvent); - } - - public function testHandleThrowsModuleSetupValidationException() - { - $dependencies = []; - $dependencies[] = uniqid(); - $dependencies[] = uniqid(); - - $dependenciesKey = array_rand($dependencies); - $dependency = $dependencies[$dependenciesKey]; - - $beforeModuleDeactivationEvent = $this->createConfiguredStub(BeforeModuleDeactivationEvent::class, [ - 'getModuleId' => $dependency - ]); - - $this->expectException(ModuleSetupValidationException::class); - $this->expectExceptionMessage((new ModuleSetupValidationException('Module with id "' . $dependency . - '" cannot be deactivated while GraphQL Configuration Access module is active.'))->getMessage()); - - $sut = new BeforeModuleDeactivation($dependencies); - $sut->handle($beforeModuleDeactivationEvent); - } -}