You are here

public function FeaturesManagerKernelTest::testCreateConfiguration in Features 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/FeaturesManagerKernelTest.php \Drupal\Tests\features\Kernel\FeaturesManagerKernelTest::testCreateConfiguration()

@covers \Drupal\features\FeaturesManager::createConfiguration

File

tests/src/Kernel/FeaturesManagerKernelTest.php, line 52

Class

FeaturesManagerKernelTest
The Feature Manager Kernel Test.

Namespace

Drupal\Tests\features\Kernel

Code

public function testCreateConfiguration() {
  $config_name = 'system_simple.testcreate';
  $config = [
    'string_value' => 'example',
    'array_value' => [
      'item1' => 'value1',
      'item2' => 'value2',
    ],
  ];
  $this->featuresManager
    ->createConfiguration([
    $config_name => $config,
  ]);
  $config_item = $this->configFactory
    ->get($config_name);
  $this
    ->assertEquals($config['string_value'], $config_item
    ->get('string_value'), 'Test config string saved');
  $this
    ->assertEquals($config['array_value'], $config_item
    ->get('array_value'), 'Test config array saved');
}