You are here

public function BasicTest::testNaturalSortDefaultSymbols in Views Natural Sort 8.2

File

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

Class

BasicTest
@group views_natural_sort

Namespace

Drupal\Tests\views_natural_sort\Kernel

Code

public function testNaturalSortDefaultSymbols() {
  $node1 = Node::create([
    'type' => 'views_natural_sort_test_content',
    'title' => 'A(Z',
  ]);
  $node1
    ->save();
  $node2 = Node::create([
    'type' => 'views_natural_sort_test_content',
    'title' => 'A[B',
  ]);
  $node2
    ->save();
  $node3 = Node::create([
    'type' => 'views_natural_sort_test_content',
    'title' => 'A\\C',
  ]);
  $node3
    ->save();
  $view = Views::getView('views_natural_sort_test');
  $view
    ->setDisplay();
  $view
    ->preview('default');
  $this
    ->assertIdenticalResultset($view, [
    [
      'title' => 'A[B',
    ],
    [
      'title' => 'A\\C',
    ],
    [
      'title' => 'A(Z',
    ],
  ], [
    'title' => 'title',
  ]);
}