You are here

public function DisplayTest::testTranslationSetting in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testTranslationSetting()
  2. 9 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testTranslationSetting()

Tests translation rendering settings based on entity translatability.

File

core/modules/views/tests/src/Functional/Plugin/DisplayTest.php, line 416

Class

DisplayTest
Tests the basic display plugin.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function testTranslationSetting() {
  \Drupal::service('module_installer')
    ->install([
    'file',
  ]);

  // By default there should be no language settings.
  $this
    ->checkTranslationSetting();
  \Drupal::service('module_installer')
    ->install([
    'language',
  ]);

  // Enabling the language module should not make a difference.
  $this
    ->checkTranslationSetting();

  // Making the site multilingual should let translatable entity types support
  // translation rendering.
  ConfigurableLanguage::createFromLangcode('it')
    ->save();
  $this
    ->checkTranslationSetting(TRUE);
}