Commit e8251b2a authored by webchick's avatar webchick
Browse files

Issue #2057199 by lauriii, olli: Unable to select the 'Default' view mode for custom block.

parent da7d7a95
......@@ -92,7 +92,7 @@ public function defaultConfiguration() {
* Adds body and description fields to the block configuration form.
public function blockForm($form, &$form_state) {
$options = array();
$options = array('default' => t('Default'));
$view_modes = entity_get_view_modes('custom_block');
foreach ($view_modes as $view_mode => $detail) {
$options[$view_mode] = $detail['label'];
......@@ -78,6 +78,10 @@ public function testCustomBlockCreation() {
$this->assertFieldByXPath('//select[@name="settings[custom_block][view_mode]"]/option[@selected="selected"]/@value', 'test_view_mode', 'View mode changed to Test View Mode');
// Test the available view mode options.
$this->assertOption('edit-settings-custom-block-view-mode', 'default', 'The default view mode is available.');
$this->assertOption('edit-settings-custom-block-view-mode', 'full', 'The full view mode is available.');
// Check that the block exists in the database.
$blocks = entity_load_multiple_by_properties('custom_block', array('info' => $edit['info']));
$block = reset($blocks);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment