function DbLogControllerTest::testNonLatinCharacters

Same name in other branches
  1. 9 core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php \Drupal\Tests\dblog\Kernel\DbLogControllerTest::testNonLatinCharacters()
  2. 10 core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php \Drupal\Tests\dblog\Kernel\DbLogControllerTest::testNonLatinCharacters()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.