You are here

public function ConfigIgnoreTest::testValidateIgnoring 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::testValidateIgnoring()

Verify that config can get ignored.

File

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

Class

ConfigIgnoreTest
Test functionality of config_ignore module.

Namespace

Drupal\Tests\config_ignore\Functional

Code

public function testValidateIgnoring() {

  // 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.site',
  ])
    ->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'));
}