function CKEditorTest::testInternalGetConfig

Tests Internal::getConfig().

File

drupal/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php, line 162
Definition of \Drupal\ckeditor\Tests\CKEditorTest.

Class

CKEditorTest
Tests for the 'CKEditor' text editor plugin.

Namespace

Drupal\ckeditor\Tests

Code

function testInternalGetConfig() {
  $editor = entity_load('editor', 'filtered_html');
  $manager = drupal_container()
    ->get('plugin.manager.ckeditor.plugin');
  $internal_plugin = $manager
    ->createInstance('internal');

  // Default toolbar.
  $expected = $this
    ->getDefaultInternalConfig();
  $this
    ->assertIdentical($expected, $internal_plugin
    ->getConfig($editor), '"Internal" plugin configuration built correctly for default toolbar.');

  // Format dropdown/button enabled: new setting should be present.
  $editor->settings['toolbar']['buttons'][0][] = 'Format';
  $expected['format_tags'] = 'p;h4;h5;h6';
  $this
    ->assertIdentical($expected, $internal_plugin
    ->getConfig($editor), '"Internal" plugin configuration built correctly for customized toolbar.');
}