function MachineNameTransliterationTest::testMachineNameTransliterations

Same name in other branches
  1. 11.x core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php \Drupal\FunctionalJavascriptTests\MachineName\MachineNameTransliterationTest::testMachineNameTransliterations()

Test for machine name transliteration functionality.

@dataProvider machineNameInputOutput

File

core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php, line 52

Class

MachineNameTransliterationTest
Tests the machine name transliteration functionality.

Namespace

Drupal\FunctionalJavascriptTests\MachineName

Code

public function testMachineNameTransliterations($langcode, $input, $output) : void {
    $page = $this->getSession()
        ->getPage();
    if ($langcode !== 'en') {
        ConfigurableLanguage::createFromLangcode($langcode)->save();
    }
    $this->config('system.site')
        ->set('default_langcode', $langcode)
        ->save();
    $this->rebuildContainer();
    $this->drupalGet("/admin/people/roles/add");
    $page->find('css', '[data-drupal-selector="edit-label"]')
        ->setValue($input);
    $this->assertSession()
        ->elementTextEquals('css', 'span.machine-name-value', $output);
}

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