You are here

public function ConfigEntityImportTest::assertConfigUpdateImport in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php \Drupal\Tests\system\Kernel\Entity\ConfigEntityImportTest::assertConfigUpdateImport()

Asserts that config entities are updated during import.

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.

6 calls to ConfigEntityImportTest::assertConfigUpdateImport()
ConfigEntityImportTest::doActionUpdate in core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
Tests updating an action during import.
ConfigEntityImportTest::doBlockUpdate in core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
Tests updating a block during import.
ConfigEntityImportTest::doFilterFormatUpdate in core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
Tests updating a filter format during import.
ConfigEntityImportTest::doImageStyleUpdate in core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
Tests updating an image style during import.
ConfigEntityImportTest::doSearchPageUpdate in core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
Tests updating a search page during import.

... See full list

File

core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php, line 258

Class

ConfigEntityImportTest
Tests ConfigEntity importing.

Namespace

Drupal\Tests\system\Kernel\Entity

Code

public function assertConfigUpdateImport($name, $original_data, $custom_data) {
  $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);
}