You are here

public function ConfigImportLocaleTest::testSettingsForm in Locale: Config import 8

Verify that the settings form works.

File

tests/src/Functional/ConfigImportLocaleTest.php, line 19

Class

ConfigImportLocaleTest
Test functionality of config_import_locale module.

Namespace

Drupal\Tests\config_import_locale\Functional

Code

public function testSettingsForm() {

  // Login with a user that has permission to access the config import locale
  // settings.
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'administer config import locale',
  ]));
  $edit = [
    'overwrite_interface_translation' => 'no_overwrite',
  ];
  $this
    ->drupalGet('/admin/config/regional/translate/config-import-settings');
  $this
    ->submitForm($edit, t('Save configuration'));
  $settings = $this
    ->config('config_import_locale.settings')
    ->get('overwrite_interface_translation');
  $this
    ->assertEquals('no_overwrite', $settings);
}