You are here

public function DbLogControllerTest::testNonLatinCharacters in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php \Drupal\Tests\dblog\Kernel\DbLogControllerTest::testNonLatinCharacters()

Tests links with non latin characters.

File

core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php, line 29

Class

DbLogControllerTest
Tests for the DbLogController class.

Namespace

Drupal\Tests\dblog\Kernel

Code

public function testNonLatinCharacters() {
  $link = 'hello-
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
      科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰';
  \Drupal::logger('my_module')
    ->warning('test', [
    'link' => $link,
  ]);
  $log = \Drupal::database()
    ->select('watchdog', 'w')
    ->fields('w', [
    'link',
  ])
    ->condition('link', '', '<>')
    ->execute()
    ->fetchField();
  $this
    ->assertEquals($log, $link);
}