function CKEditorPluginManagerTest::testGetEnabledButtons

Same name in other branches
  1. 9 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);
}

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