function StylePluginTest::providerGetDynamicPluginConfig

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

Provides a list of configs to test.

File

core/modules/ckeditor5/tests/src/Unit/StylePluginTest.php, line 21

Class

StylePluginTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21ckeditor5%21src%21Plugin%21CKEditor5Plugin%21Style.php/class/Style/9" title="CKEditor 5 Style plugin configuration." class="local">\Drupal\ckeditor5\Plugin\CKEditor5Plugin\Style</a> @group ckeditor5 @internal

Namespace

Drupal\Tests\ckeditor5\Unit

Code

public function providerGetDynamicPluginConfig() : array {
    return [
        'default configuration (empty)' => [
            [
                'styles' => [],
            ],
            [
                'style' => [
                    'definitions' => [],
                ],
            ],
        ],
        'Simple' => [
            [
                'styles' => [
                    [
                        'label' => 'fancy blockquote',
                        'element' => '<blockquote class="fancy">',
                    ],
                ],
            ],
            [
                'style' => [
                    'definitions' => [
                        [
                            'name' => 'fancy blockquote',
                            'element' => 'blockquote',
                            'classes' => [
                                'fancy',
                            ],
                        ],
                    ],
                ],
            ],
        ],
        'Complex' => [
            [
                'styles' => [
                    [
                        'label' => 'fancy highlighted blockquote',
                        'element' => '<blockquote class="fancy highlighted">',
                    ],
                    [
                        'label' => 'important foobar',
                        'element' => '<foobar class="important">',
                    ],
                ],
            ],
            [
                'style' => [
                    'definitions' => [
                        [
                            'name' => 'fancy highlighted blockquote',
                            'element' => 'blockquote',
                            'classes' => [
                                'fancy',
                                'highlighted',
                            ],
                        ],
                        [
                            'name' => 'important foobar',
                            'element' => 'foobar',
                            'classes' => [
                                'important',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ];
}

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