Skip to content

Commit

Permalink
Fixed typo and added test (#107)
Browse files Browse the repository at this point in the history
* Bugfixes

* minor
  • Loading branch information
Nyholm authored Dec 12, 2019
1 parent 8b2286c commit bc506b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/DmishhSettingsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
5 changes: 5 additions & 0 deletions Tests/Functional/ServiceInstantiationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down
16 changes: 9 additions & 7 deletions Tests/Resources/app/config/config.yml
Original file line number Diff line number Diff line change
@@ -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: ~

0 comments on commit bc506b3

Please sign in to comment.