You are here

protected function GTMTestBase::modifySettings in GoogleTagManager 8

Modify settings for test purposes.

Parameters

bool $include_file: The include_file module setting.

1 call to GTMTestBase::modifySettings()
GTMTestBase::testModule in tests/src/Functional/GTMTestBase.php
Test the module.

File

tests/src/Functional/GTMTestBase.php, line 107

Class

GTMTestBase
Tests the Google Tag Manager.

Namespace

Drupal\Tests\google_tag\Functional

Code

protected function modifySettings($include_file = TRUE) {

  // Modify default settings.
  // These should propagate to each container created in test.
  $config = $this
    ->config('google_tag.settings');
  $settings = $config
    ->get();
  unset($settings['_core']);
  $settings['include_file'] = $include_file;
  $settings['flush_snippets'] = 1;
  $settings['debug_output'] = 1;
  $settings['_default_container']['role_toggle'] = 'include listed';
  $settings['_default_container']['role_list'] = [
    'content viewer' => 'content viewer',
  ];
  $config
    ->setData($settings)
    ->save();
}