function AlignmentPluginTest::providerGetDynamicPluginConfig

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

Provides a list of configs to test.

File

core/modules/ckeditor5/tests/src/Unit/AlignmentPluginTest.php, line 22

Class

AlignmentPluginTest
@coversDefaultClass \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Alignment[[api-linebreak]] @group ckeditor5 @internal

Namespace

Drupal\Tests\ckeditor5\Unit

Code

public static function providerGetDynamicPluginConfig() : array {
  return [
    'All alignments' => [
      Alignment::DEFAULT_CONFIGURATION,
      [
        'alignment' => [
          'options' => [
            [
              'name' => 'left',
              'className' => 'text-align-left',
            ],
            [
              'name' => 'center',
              'className' => 'text-align-center',
            ],
            [
              'name' => 'right',
              'className' => 'text-align-right',
            ],
            [
              'name' => 'justify',
              'className' => 'text-align-justify',
            ],
          ],
        ],
      ],
    ],
    'No alignments allowed' => [
      [
        'enabled_alignments' => [],
      ],
      [
        'alignment' => [
          'options' => [],
        ],
      ],
    ],
    'Left only' => [
      [
        'enabled_alignments' => [
          'left',
        ],
      ],
      [
        'alignment' => [
          'options' => [
            [
              'name' => 'left',
              'className' => 'text-align-left',
            ],
          ],
        ],
      ],
    ],
    'Left and justify only' => [
      [
        'enabled_alignments' => [
          'left',
          'justify',
        ],
      ],
      [
        'alignment' => [
          'options' => [
            [
              'name' => 'left',
              'className' => 'text-align-left',
            ],
            [
              'name' => 'justify',
              'className' => 'text-align-justify',
            ],
          ],
        ],
      ],
    ],
  ];
}

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