You are here

public function SupportTicketViewLanguageTest::testViewLanguage in Support Ticketing System 8

Tests the language extra field display.

File

modules/support_ticket/src/Tests/SupportTicketViewLanguageTest.php, line 36
Contains \Drupal\support_ticket\Tests\SupportTicketViewLanguageTest.

Class

SupportTicketViewLanguageTest
Tests the support_ticket language extra field display.

Namespace

Drupal\support_ticket\Tests

Code

public function testViewLanguage() {

  // Add Spanish language.
  ConfigurableLanguage::createFromLangcode('es')
    ->save();

  // Set language field visible.
  entity_get_display('support_ticket', 'ticket', 'default')
    ->setComponent('langcode')
    ->save();

  // Create a support_ticket in Spanish.
  $support_ticket = $this
    ->drupalCreateSupportTicket(array(
    'langcode' => 'es',
  ));
  $this
    ->drupalGet($support_ticket
    ->urlInfo());
  $this
    ->assertText('Spanish', 'The language field is displayed properly.');
}