You are here

public function ConfigIgnoreHookTest::testSettingsAlterHook in Config Ignore 8.2

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

Test hook implementation of another module.

File

tests/src/Functional/ConfigIgnoreHookTest.php, line 31

Class

ConfigIgnoreHookTest
Test hook implementation of another module.

Namespace

Drupal\Tests\config_ignore\Functional

Code

public function testSettingsAlterHook() {
  $this
    ->config('system.site')
    ->set('name', 'Test import')
    ->save();
  $this
    ->doExport();
  $this
    ->config('system.site')
    ->set('name', 'Changed title')
    ->save();
  $this
    ->doImport();

  // Test if the `config_ignore_hook_test` module got to ignore the site name
  // config.
  $this
    ->assertEquals('Changed title', $this
    ->config('system.site')
    ->get('name'));
}