From bc506b38e5e2ffd3a4a6cdad4f4c0eb9a44154bd Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 12 Dec 2019 22:02:05 +0100 Subject: [PATCH] Fixed typo and added test (#107) * Bugfixes * minor --- DependencyInjection/DmishhSettingsExtension.php | 2 +- Tests/Functional/ServiceInstantiationTest.php | 5 +++++ Tests/Resources/app/config/config.yml | 16 +++++++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/DependencyInjection/DmishhSettingsExtension.php b/DependencyInjection/DmishhSettingsExtension.php index d732b17..a01de46 100644 --- a/DependencyInjection/DmishhSettingsExtension.php +++ b/DependencyInjection/DmishhSettingsExtension.php @@ -55,7 +55,7 @@ public function load(array $configs, ContainerBuilder $container) } $container->getDefinition(SettingsManager::class) - ->replaceArgument(0, $config['settings']); + ->replaceArgument(2, $config['settings']); $container->getDefinition(SettingsType::class) ->replaceArgument(0, $config['settings']); diff --git a/Tests/Functional/ServiceInstantiationTest.php b/Tests/Functional/ServiceInstantiationTest.php index 9bfcba7..46523b2 100644 --- a/Tests/Functional/ServiceInstantiationTest.php +++ b/Tests/Functional/ServiceInstantiationTest.php @@ -3,6 +3,8 @@ namespace Dmishh\SettingsBundle\Tests\Functional; use Dmishh\SettingsBundle\DmishhSettingsBundle; +use Dmishh\SettingsBundle\Manager\SettingsManager; +use Dmishh\SettingsBundle\Manager\SettingsManagerInterface; use Dmishh\SettingsBundle\Serializer\PhpSerializer; use Dmishh\SettingsBundle\Serializer\SerializerInterface; use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; @@ -34,6 +36,9 @@ public function testInitBundle() self::assertTrue($container->has(SerializerInterface::class)); $service = $container->get(SerializerInterface::class); self::assertInstanceOf(PhpSerializer::class, $service); + + $service = $container->get(SettingsManagerInterface::class); + self::assertInstanceOf(SettingsManager::class, $service); } protected function getBundleClass() diff --git a/Tests/Resources/app/config/config.yml b/Tests/Resources/app/config/config.yml index d0db5ef..2b8f7ae 100644 --- a/Tests/Resources/app/config/config.yml +++ b/Tests/Resources/app/config/config.yml @@ -1,12 +1,14 @@ framework: - secret: foobar - translator: ~ + secret: foobar + translator: ~ doctrine: - dbal: - driver: pdo_mysql - orm: ~ + dbal: + driver: 'pdo_pgsql' + server_version: '10' + orm: + auto_mapping: true dmishh_settings: - settings: - my_first_setting: ~ + settings: + my_first_setting: ~