function PhpTransliterationTest::testRemoveDiacritics

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php \Drupal\Tests\Component\Transliteration\PhpTransliterationTest::testRemoveDiacritics()
  2. 10 core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php \Drupal\Tests\Component\Transliteration\PhpTransliterationTest::testRemoveDiacritics()
  3. 11.x 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);
}

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