You are here

public function BasicTest::testStoringLongUnicode in Views Natural Sort 8.2

File

tests/src/Kernel/BasicTest.php, line 282

Class

BasicTest
@group views_natural_sort

Namespace

Drupal\Tests\views_natural_sort\Kernel

Code

public function testStoringLongUnicode() {
  $node = Node::create([
    'type' => 'views_natural_sort_test_content',
    'title' => str_repeat('⌘', 255),
  ]);
  $node
    ->save();

  // TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
  // You will need to use `\Drupal\core\Database\Database::getConnection()` if you do not yet have access to the container here.
  $content = \Drupal::database()
    ->select('views_natural_sort', 'vns')
    ->fields('vns', [
    'content',
  ])
    ->condition('vns.eid', $node
    ->id())
    ->condition('vns.entity_type', 'node')
    ->execute()
    ->fetchField();
  $this
    ->assertEqual($content, str_repeat('⌘', 255));
}