function CKEditorPluginManagerTest::testGetEnabledButtons

Same name and namespace in other branches
  1. 8.9.x 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 89

Class

CKEditorPluginManagerTest
@coversDefaultClass \Drupal\ckeditor\CKEditorPluginManager[[api-linebreak]]

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);
}

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