You are here

public function ConfigIgnoreTest::testValidateIgnoringWithWildcard in Config Ignore 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/ConfigIgnoreTest.php \Drupal\Tests\config_ignore\Functional\ConfigIgnoreTest::testValidateIgnoringWithWildcard()

Verify all wildcard asterisk is working.

File

tests/src/Functional/ConfigIgnoreTest.php, line 99

Class

ConfigIgnoreTest
Test functionality of config_ignore module.

Namespace

Drupal\Tests\config_ignore\Functional

Code

public function testValidateIgnoringWithWildcard() {

  // Set the site name to a known value that we later will try and overwrite.
  $this
    ->config('system.site')
    ->set('name', 'Test import')
    ->save();

  // Set the system.site:name to be ignored upon config import.
  $this
    ->config('config_ignore.settings')
    ->set('ignored_config_entities', [
    'system.' . IgnoreFilter::INCLUDE_SUFFIX,
  ])
    ->save();
  $this
    ->doExport();

  // Change the site name, perform an import and see if the site name remains
  // the same, as it should.
  $this
    ->config('system.site')
    ->set('name', 'Changed title')
    ->save();
  $this
    ->doImport();
  $this
    ->assertEquals('Changed title', $this
    ->config('system.site')
    ->get('name'));
}