You are here

public function ConfigImportTest::setUp in Entity Construction Kit (ECK) 8

Overrides FunctionalTestBase::setUp

File

tests/src/Functional/ConfigImportTest.php, line 22

Class

ConfigImportTest
Class ConfigImportTest.

Namespace

Drupal\Tests\eck\Functional

Code

public function setUp() {
  parent::setUp();
  $permissions = [
    'export configuration',
    'synchronize configuration',
    'administer eck entity types',
    'administer eck entities',
    'administer eck entity bundles',
    'bypass eck entity access',
  ];
  $this
    ->drupalLogin($this
    ->drupalCreateUser($permissions));

  // Export the current configuration.
  $configFactory = \Drupal::configFactory();

  /** @var \Drupal\Core\Config\StorageInterface $sync */
  $sync = $this->container
    ->get('config.storage.sync');
  $config = $configFactory
    ->loadMultiple($configFactory
    ->listAll());
  foreach ($config as $name => $conf) {
    $sync
      ->write($name, $conf
      ->getRawData());
  }
}