diff --git a/DependencyInjection/QandidateToggleExtension.php b/DependencyInjection/QandidateToggleExtension.php index 6f69de1..615b8b7 100644 --- a/DependencyInjection/QandidateToggleExtension.php +++ b/DependencyInjection/QandidateToggleExtension.php @@ -11,6 +11,7 @@ namespace Qandidate\Bundle\ToggleBundle\DependencyInjection; +use Qandidate\Toggle\ToggleCollection\InMemoryCollection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -43,7 +44,7 @@ public function load(array $configs, ContainerBuilder $container) break; case 'factory' === $config['persistence']: $collection = 'factory'; - $definition = new Definition('qandidate.toggle.collection.in_memory'); + $definition = new Definition(InMemoryCollection::class); $definition->setFactory(array( new Reference($config['collection_factory']['service_id']), $config['collection_factory']['method'] diff --git a/Tests/DependencyInjection/QandidateToggleExtensionTest.php b/Tests/DependencyInjection/QandidateToggleExtensionTest.php index f21989c..78c83e9 100644 --- a/Tests/DependencyInjection/QandidateToggleExtensionTest.php +++ b/Tests/DependencyInjection/QandidateToggleExtensionTest.php @@ -105,6 +105,7 @@ public function it_creates_the_toggle_collection_factory_definition() $definition = $this->container->getDefinition('qandidate.toggle.collection.factory'); $factory = $definition->getFactory(); + $this->assertSame(InMemoryCollection::class, $definition->getClass()); $this->assertArrayHasKey(0, $factory); $this->assertArrayHasKey(1, $factory); $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $factory[0]);