From 51ad4ddf2541909904cb3ab69001b4975101e7fc Mon Sep 17 00:00:00 2001 From: Artem Henvald Date: Wed, 11 Nov 2020 22:51:25 +0200 Subject: [PATCH] Add service definition for Fresh\DateTime\DateTimeHelper (#10) --- Resources/config/services.yaml | 3 +++ Tests/DependencyInjection/FreshCentrifugoExtensionTest.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Resources/config/services.yaml b/Resources/config/services.yaml index 3c4fd6e..8959507 100644 --- a/Resources/config/services.yaml +++ b/Resources/config/services.yaml @@ -9,6 +9,9 @@ services: $centrifugoSecret: '%env(CENTRIFUGO_SECRET)%' iterable $channelAuthenticators: !tagged_iterator 'centrifugo.channel_authenticator' + Fresh\DateTime\DateTimeHelper: + class: Fresh\DateTime\DateTimeHelper + Fresh\CentrifugoBundle\: resource: '../../{Command,Logger,Service}/' exclude: '../../Service/Centrifugo.php' diff --git a/Tests/DependencyInjection/FreshCentrifugoExtensionTest.php b/Tests/DependencyInjection/FreshCentrifugoExtensionTest.php index e31e4a1..9a1a37d 100644 --- a/Tests/DependencyInjection/FreshCentrifugoExtensionTest.php +++ b/Tests/DependencyInjection/FreshCentrifugoExtensionTest.php @@ -15,6 +15,7 @@ use Fresh\CentrifugoBundle\DependencyInjection\FreshCentrifugoExtension; use Fresh\CentrifugoBundle\Service\CentrifugoInterface; use Fresh\CentrifugoBundle\Service\ResponseProcessor; +use Fresh\DateTime\DateTimeHelper; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; @@ -54,8 +55,10 @@ public function testLoadExtension(): void self::assertArrayHasKey(CentrifugoInterface::class, $this->container->getRemovedIds()); self::assertArrayHasKey(ResponseProcessor::class, $this->container->getRemovedIds()); + self::assertArrayHasKey(DateTimeHelper::class, $this->container->getRemovedIds()); self::assertArrayNotHasKey(CentrifugoInterface::class, $this->container->getDefinitions()); self::assertArrayNotHasKey(ResponseProcessor::class, $this->container->getDefinitions()); + self::assertArrayNotHasKey(DateTimeHelper::class, $this->container->getDefinitions()); self::assertTrue($this->container->hasParameter('centrifugo.channel_max_length')); self::assertSame(255, $this->container->getParameter('centrifugo.channel_max_length'));