function CKEditor5Test::providerPathsToFormNames

Same name in other branches
  1. 10 core/modules/ckeditor5/tests/src/Unit/CKEditor5Test.php \Drupal\Tests\ckeditor5\Unit\CKEditor5Test::providerPathsToFormNames()
  2. 11.x core/modules/ckeditor5/tests/src/Unit/CKEditor5Test.php \Drupal\Tests\ckeditor5\Unit\CKEditor5Test::providerPathsToFormNames()

Data provider for testing mapViolationPropertyPathsToFormNames.

Return value

array[] An array with the property path and expected form item name.

File

core/modules/ckeditor5/tests/src/Unit/CKEditor5Test.php, line 65

Class

CKEditor5Test
@coversDefaultClass \Drupal\ckeditor5\Plugin\Editor\CKEditor5 @group ckeditor5 @internal

Namespace

Drupal\Tests\ckeditor5\Unit

Code

public function providerPathsToFormNames() : array {
    return [
        'validation error targeting toolbar items' => [
            'settings.toolbar.items',
            'settings][toolbar][items',
        ],
        'validation error targeting a specific toolbar item' => [
            'settings.toolbar.items.6',
            'settings][toolbar][items',
        ],
        'validation error targeting a simple plugin form' => [
            'settings.plugins.providerA_plugin1',
            'settings][plugins][providerA_plugin1',
        ],
        'validation error targeting a simple plugin form, with deep config schema detail' => [
            'settings.plugins.providerA_plugin1.foo.bar.baz',
            'settings][plugins][providerA_plugin1',
        ],
        'validation error targeting a complex plugin form' => [
            'settings.plugins.providerB_plugin2',
            'settings][plugins][providerB_plugin2',
        ],
        'validation error targeting a complex plugin form, with deep config schema detail' => [
            'settings.plugins.providerB_plugin2.foo.bar.baz',
            'settings][plugins][providerB_plugin2][foo',
        ],
        'unrealistic example one — should trigger exception' => [
            'bad.bad.worst',
            'I DO NOT EXIST',
            TRUE,
        ],
        'unrealistic example two — should trigger exception' => [
            'one.two.three.four',
            'one][two][three][four',
            TRUE,
        ],
    ];
}

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