You are here

public function ConfigTranslationUiTest::testAlterInfo in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationUiTest::testAlterInfo()

Tests the config_translation_info_alter() hook.

File

core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php, line 886

Class

ConfigTranslationUiTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function testAlterInfo() {
  $this
    ->drupalLogin($this->adminUser);
  $this->container
    ->get('state')
    ->set('config_translation_test_config_translation_info_alter', TRUE);
  $this->container
    ->get('plugin.manager.config_translation.mapper')
    ->clearCachedDefinitions();

  // Check out if the translation page has the altered in settings.
  $this
    ->drupalGet('admin/config/system/site-information/translate/fr/add');
  $this
    ->assertText(t('Feed channel'));
  $this
    ->assertText(t('Feed description'));

  // Check if the translation page does not have the altered out settings.
  $this
    ->drupalGet('admin/config/people/accounts/translate/fr/add');
  $this
    ->assertText(t('Name'));
  $this
    ->assertNoText(t('Account cancellation confirmation'));
  $this
    ->assertNoText(t('Password recovery'));
}