diff --git a/EventSubscriber/AmpOptimizerSubscriber.php b/EventSubscriber/AmpOptimizerSubscriber.php index befb325..33670b0 100644 --- a/EventSubscriber/AmpOptimizerSubscriber.php +++ b/EventSubscriber/AmpOptimizerSubscriber.php @@ -133,4 +133,12 @@ public function setEnabled(bool $enabled): void { $this->config['transform_enabled'] = $enabled; } + + /** + * @return bool + */ + public function isEnabled(): bool + { + return $this->config['transform_enabled']; + } } \ No newline at end of file diff --git a/Tests/Unit/EventSubscriber/AmpOptimizerSubscriberTest.php b/Tests/Unit/EventSubscriber/AmpOptimizerSubscriberTest.php index f55d76d..306d1ff 100644 --- a/Tests/Unit/EventSubscriber/AmpOptimizerSubscriberTest.php +++ b/Tests/Unit/EventSubscriber/AmpOptimizerSubscriberTest.php @@ -278,6 +278,16 @@ public function testDisabledByProperty() $instance->onKernelResponse($event); } + /** + * Test isEnabled property + */ + public function testIsEnabledProperty() + { + $instance = $this->getInstanceDisabledByProperty(); + $instance->setEnabled(false); + $this->assertFalse($instance->isEnabled()); + } + /** * Provide instance to test with disabled by property and test calls * @return AmpOptimizerSubscriber