diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php index aab1098..19a0d9e 100644 --- a/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php +++ b/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php @@ -101,7 +101,10 @@ function testWithoutEditorAvailable() { // Verify the editor configuration is saved correctly. $editor = editor_load('filtered_html'); $this->assertIdentical($editor->editor, 'unicorn', 'The text editor is configured correctly.'); - $this->assertIdentical($editor->settings, array('foo' => 'baz'), 'The text editor settings are stored correctly'); + $this->assertIdentical($editor->settings['foo'], 'baz', 'The text editor settings are stored correctly.'); + $this->assertIdentical($editor->settings['ponies too'], true, 'The text editor defaults are retrieved correctly.'); + $this->assertIdentical($editor->settings['rainbows'], true, 'The text editor defaults added by hook_editor_settings_defaults() are retrieved correctly.'); + $this->assertIdentical($editor->settings['sparkles'], false, 'The text editor defaults modified by hook_editor_settings_defaults_alter() are retrieved correctly.'); $this->drupalGet('admin/config/content/formats/filtered_html'); $select = $this->xpath('//select[@name="editor"]'); $select_is_disabled = $this->xpath('//select[@name="editor" and @disabled="disabled"]'); diff --git a/core/modules/editor/tests/modules/editor_test.module b/core/modules/editor/tests/modules/editor_test.module index 7c56259..4527dde 100644 --- a/core/modules/editor/tests/modules/editor_test.module +++ b/core/modules/editor/tests/modules/editor_test.module @@ -4,3 +4,24 @@ * @file * Helper module for the Text Editor tests. */ + +/** + * Implements hook_editor_default_settings(). + */ +function editor_test_editor_default_settings($editor) { + if ($editor === 'unicorn') { + return array( + 'rainbows' => TRUE, + 'sparkles' => TRUE, + ); + } +} + +/** + * Implements hook_editor_default_settings_alter(). + */ +function editor_test_editor_default_settings_alter(&$settings, $editor) { + if ($editor === 'unicorn' && isset($settings['sparkles'])) { + $settings['sparkles'] = FALSE; + } +}