function SearchPageImportTest::assertConfigUpdateImport

Asserts that config entities are updated during import.

@internal

Parameters

string $name: The name of the config object.

array $original_data: The original data stored in the config object.

array $custom_data: The new data to store in the config object.

File

core/modules/search/tests/src/Kernel/SearchPageImportTest.php, line 104

Class

SearchPageImportTest
Tests search page import.

Namespace

Drupal\Tests\search\Kernel

Code

public function assertConfigUpdateImport(string $name, array $original_data, array $custom_data) : void {
  $this->container
    ->get('config.storage.sync')
    ->write($name, $custom_data);
  // Verify the active configuration still returns the default values.
  $config = $this->config($name);
  $this->assertSame($config->get(), $original_data);
  // Import.
  $this->configImporter()
    ->import();
  // Verify the values were updated.
  $this->container
    ->get('config.factory')
    ->reset($name);
  $config = $this->config($name);
  $this->assertSame($config->get(), $custom_data);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.