Verifies unicorn editor configuration.
string $format_id: The format machine name.
string $foo: The expected value of the foo setting.
protected function verifyUnicornEditorConfiguration($format_id, $foo = 'bar') {
$editor = editor_load($format_id);
$this
->assertIdentical($editor->editor, 'unicorn', 'The text editor is configured correctly.');
$this
->assertIdentical($editor->settings['foo'], $foo, '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/' . $format_id);
$select = $this
->xpath('//select[@name="editor[editor]"]');
$select_is_disabled = $this
->xpath('//select[@name="editor[editor]" and @disabled="disabled"]');
$options = $this
->xpath('//select[@name="editor[editor]"]/option');
$this
->assertTrue(count($select) === 1, 'The Text Editor select exists.');
$this
->assertTrue(count($select_is_disabled) === 0, 'The Text Editor select is not disabled.');
$this
->assertTrue(count($options) === 2, 'The Text Editor select has two options.');
$this
->assertTrue((string) $options[1]['selected'] === 'selected', 'Option 2 ("Unicorn Editor") is selected.');
}