You are here

public function CKEditorPluginManagerTest::testGetEnabledButtons in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/ckeditor/tests/src/Unit/CKEditorPluginManagerTest.php \Drupal\Tests\ckeditor\Unit\CKEditorPluginManagerTest::testGetEnabledButtons()

@covers ::getEnabledButtons @dataProvider providerGetEnabledButtons

File

core/modules/ckeditor/tests/src/Unit/CKEditorPluginManagerTest.php, line 88

Class

CKEditorPluginManagerTest
@coversDefaultClass \Drupal\ckeditor\CKEditorPluginManager

Namespace

Drupal\Tests\ckeditor\Unit

Code

public function testGetEnabledButtons(array $toolbar_rows, array $expected_buttons) {
  $editor = $this
    ->prophesize(Editor::class);
  $editor
    ->getSettings()
    ->willReturn([
    'toolbar' => [
      'rows' => $toolbar_rows,
    ],
  ]);
  $enabled_buttons = CKEditorPluginManager::getEnabledButtons($editor
    ->reveal());
  $this
    ->assertEquals($expected_buttons, $enabled_buttons);
}