Skip to content

Commit

Permalink
Configured correct classname instead of id (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricbra authored and othillo committed Aug 11, 2018
1 parent 38eee98 commit bda37ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DependencyInjection/QandidateToggleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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']
Expand Down
1 change: 1 addition & 0 deletions Tests/DependencyInjection/QandidateToggleExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit bda37ea

Please sign in to comment.