You are here

public function DisplayTest::testTranslationSetting in Zircon Profile 8

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

Test translation rendering settings based on entity translatability.

File

core/modules/views/src/Tests/Plugin/DisplayTest.php, line 358
Contains \Drupal\views\Tests\Plugin\DisplayTest.

Class

DisplayTest
Tests the basic display plugin.

Namespace

Drupal\views\Tests\Plugin

Code

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

  // 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);
}