function LanguageTest::provider

Same name in this branch
  1. 11.x core/modules/ckeditor5/tests/src/FunctionalJavascript/LanguageTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\LanguageTest::provider()
Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/FunctionalJavascript/LanguageTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\LanguageTest::provider()
  2. 9 core/modules/ckeditor5/tests/src/Kernel/LanguageTest.php \Drupal\Tests\ckeditor5\Kernel\LanguageTest::provider()
  3. 10 core/modules/ckeditor5/tests/src/FunctionalJavascript/LanguageTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\LanguageTest::provider()
  4. 10 core/modules/ckeditor5/tests/src/Kernel/LanguageTest.php \Drupal\Tests\ckeditor5\Kernel\LanguageTest::provider()

Provides a list of language code pairs.

Return value

string[][]

File

core/modules/ckeditor5/tests/src/Kernel/LanguageTest.php, line 103

Class

LanguageTest
Tests language resolving for CKEditor 5.

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

public static function provider() : array {
    $random_langcode = Random::machineName();
    return [
        'Language code transformed from browser mappings' => [
            'drupal_langcode' => 'pt-pt',
            'cke5_langcode' => 'pt',
        ],
        'Language code transformed from browser mappings 2' => [
            'drupal_langcode' => 'zh-hans',
            'cke5_langcode' => 'zh-cn',
        ],
        'Language code both in Drupal and CKEditor' => [
            'drupal_langcode' => 'fi',
            'cke5_langcode' => 'fi',
        ],
        'Language code not in Drupal but in CKEditor 5 requires new language.mappings entry' => [
            'drupal_langcode' => $random_langcode,
            'cke5_langcode' => 'de-ch',
            'is_missing_mapping' => TRUE,
        ],
    ];
}

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