You are here

public function SupportTicketViewTest::testMultiByteUtf8 in Support Ticketing System 8

Tests that we store and retrieve multi-byte UTF-8 characters correctly.

File

modules/support_ticket/src/Tests/SupportTicketViewTest.php, line 53
Contains \Drupal\support_ticket\Tests\SupportTicketViewTest.

Class

SupportTicketViewTest
Tests the support_ticket/{support_ticket} page.

Namespace

Drupal\support_ticket\Tests

Code

public function testMultiByteUtf8() {
  $title = '🐝';
  $this
    ->assertTrue(mb_strlen($title, 'utf-8') < strlen($title), 'Title has multi-byte characters.');
  $support_ticket = $this
    ->drupalCreateSupportTicket(array(
    'title' => $title,
  ));
  $this
    ->drupalGet($support_ticket
    ->urlInfo());
  $result = $this
    ->xpath('//span[contains(@class, "field--name-title")]');
  $this
    ->assertEqual((string) $result[0], $title, 'The passed title was returned.');
}