Skip to content

Commit

Permalink
Add service definition for Fresh\DateTime\DateTimeHelper (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
fre5h authored Nov 11, 2020
1 parent bbfa1fc commit 51ad4dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 3 additions & 0 deletions Tests/DependencyInjection/FreshCentrifugoExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'));
Expand Down

0 comments on commit 51ad4dd

Please sign in to comment.