You are here

public function BasicTest::testNaturalSortUnicodeSymbols in Views Natural Sort 8.2

Test Unicode symbol removal in sorting.

File

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

Class

BasicTest
@group views_natural_sort

Namespace

Drupal\Tests\views_natural_sort\Kernel

Code

public function testNaturalSortUnicodeSymbols() {
  $plugin = new RemoveSymbols([
    'settings' => "#…\",'\\()[]«?!»¡¿",
  ], '', '');
  $titles = [
    'Cuando… se abre, ¿dará algún tipo de señal?',
  ];
  $expected = [
    'Cuando se abre dará algún tipo de señal',
  ];
  foreach ($titles as $key => $title) {
    $this
      ->assertEqual($plugin
      ->transform($title), $expected[$key]);
  }
}