You are here

public function ConfigOverrideServiceProviderTest::testWithEnvironmentFileWithDots in Config override 8

@covers ::alter

File

tests/Unit/ConfigOverrideServiceProviderTest.php, line 38

Class

ConfigOverrideServiceProviderTest
@coversDefaultClass \Drupal\config_override\ConfigOverrideServiceProvider @group config_override

Namespace

Drupal\config_override\Tests\Unit

Code

public function testWithEnvironmentFileWithDots() {
  $vfs_root = vfsStream::setup('drupal_root');
  vfsStream::create([
    'sites/default/.env' => '
CONFIG___CONFIG__NAME___KEY__WITH_DOT=value
',
  ]);
  $sut = new ConfigOverrideServiceProvider();
  $container = new ContainerBuilder();
  $container
    ->set('app.root', $vfs_root
    ->url());
  $sut
    ->alter($container);
  $this
    ->assertEquals([
    'config.name' => [
      'key.with_dot' => 'value',
    ],
  ], $container
    ->getParameter('config_override__environment'));
}