SupportTicketViewLanguageTest.php in Support Ticketing System 8
File
modules/support_ticket/src/Tests/SupportTicketViewLanguageTest.php
View source
<?php
namespace Drupal\support_ticket\Tests;
use Drupal\language\Entity\ConfigurableLanguage;
class SupportTicketViewLanguageTest extends SupportTicketTestBase {
public static $modules = array(
'support_ticket',
'datetime',
'language',
);
protected function setUp() {
parent::setUp();
$web_user = $this
->drupalCreateUser(array(
'access support tickets',
));
$this
->drupalLogin($web_user);
}
public function testViewLanguage() {
ConfigurableLanguage::createFromLangcode('es')
->save();
entity_get_display('support_ticket', 'ticket', 'default')
->setComponent('langcode')
->save();
$support_ticket = $this
->drupalCreateSupportTicket(array(
'langcode' => 'es',
));
$this
->drupalGet($support_ticket
->urlInfo());
$this
->assertText('Spanish', 'The language field is displayed properly.');
}
}