You are here

protected function ConfigWithTranslationTest::assertExportedValue in Config Ignore 8.3

Asserts that a given value for a given config exists in sync.

Parameters

string $config_name: The config name.

string $key: The key of the config value. It only supports top level keys.

mixed $value: The value to be checked.

string|null $langcode: (optional) If passed, the value will be checked in the $langcode language collection.

3 calls to ConfigWithTranslationTest::assertExportedValue()
ConfigWithTranslationTest::setUp in tests/src/Functional/ConfigWithTranslationTest.php
ConfigWithTranslationTest::testConfigExport in tests/src/Functional/ConfigWithTranslationTest.php
Tests config export.
ConfigWithTranslationTest::testConfigImport in tests/src/Functional/ConfigWithTranslationTest.php
Tests config import.

File

tests/src/Functional/ConfigWithTranslationTest.php, line 231

Class

ConfigWithTranslationTest
Tests config_ignore with translated configurations.

Namespace

Drupal\Tests\config_ignore\Functional

Code

protected function assertExportedValue($config_name, $key, $value, $langcode = NULL) {

  // The file config storage is using file cache for performance reasons. As
  // the tests are running in the same request, the file static cache is not
  // cleared. We do this explicitly before making any assertions regarding
  // exported files.
  FileCache::reset();
  $sync_storage = $this
    ->getSyncStorage($langcode);

  // Check that the destination file has not been deleted.
  $this
    ->assertTrue($sync_storage
    ->exists($config_name));

  // Check that the changed value has been exported.
  $data = $sync_storage
    ->read($config_name);
  $this
    ->assertSame($value, $data[$key]);
}