Tests CKEditor::buildToolbarJSSetting().
function testBuildToolbarJSSetting() {
$editor = entity_load('editor', 'filtered_html');
// Default toolbar.
$expected = $this
->getDefaultToolbarConfig();
$this
->assertIdentical($expected, $this->ckeditor
->buildToolbarJSSetting($editor), '"toolbar" configuration part of JS settings built correctly for default toolbar.');
// Customize the configuration.
$editor->settings['toolbar']['buttons'][0][] = 'Strike';
$editor
->save();
$expected[count($expected) - 2]['items'][] = 'Strike';
$this
->assertIdentical($expected, $this->ckeditor
->buildToolbarJSSetting($editor), '"toolbar" configuration part of JS settings built correctly for customized toolbar.');
// Enable the editor_test module, customize further.
$this
->enableModules(array(
'ckeditor_test',
));
drupal_container()
->get('plugin.manager.ckeditor.plugin')
->clearCachedDefinitions();
$editor->settings['toolbar']['buttons'][0][] = 'Llama';
$editor
->save();
$expected[count($expected) - 2]['items'][] = 'Llama';
$this
->assertIdentical($expected, $this->ckeditor
->buildToolbarJSSetting($editor), '"toolbar" configuration part of JS settings built correctly for customized toolbar with contrib module-provided CKEditor plugin.');
}