You are here

public function PhpTransliterationTest::testRemoveDiacritics in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php \Drupal\Tests\Component\Transliteration\PhpTransliterationTest::testRemoveDiacritics()

Tests the PhpTransliteration::removeDiacritics() function.

@dataProvider providerTestPhpTransliterationRemoveDiacritics

Parameters

string $original: The language code to test.

string $expected: The expected return from PhpTransliteration::removeDiacritics().

File

core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php, line 29

Class

PhpTransliterationTest
Tests Transliteration component functionality.

Namespace

Drupal\Tests\Component\Transliteration

Code

public function testRemoveDiacritics($original, $expected) {
  $transliterator_class = new PhpTransliteration();
  $result = $transliterator_class
    ->removeDiacritics($original);
  $this
    ->assertEquals($expected, $result);
}