t('Forms'), 'description' => t('Tests for managing layouts on forms.'), 'group' => t('Display Suite'), ); } /** * Forms tests. */ function testDSForms() { // Create a node. $node = $this->drupalCreateNode(array('type' => 'article', 'promote' => FALSE)); // Configure teaser layout. $form = array( 'additional_settings[layout]' => 'ds_2col_stacked', ); $form_assert = array( 'regions' => array( 'header' => '' . t('Header') . '', 'left' => '' . t('Left') . '', 'right' => '' . t('Right') . '', 'footer' => '' . t('Footer') . '', ), ); $this->dsSelectLayout($form, $form_assert, 'admin/structure/types/manage/article/fields'); $fields = array( 'fields[title][region]' => 'header', 'fields[body][region]' => 'left', 'fields[field_image][region]' => 'right', 'fields[field_tags][region]' => 'right', ); $this->dsConfigureUI($fields, 'admin/structure/types/manage/article/fields'); // Inspect the node. $this->drupalGet('node/' . $node->nid . '/edit'); $this->assertRaw('ds_2col_stacked', 'ds-form class added'); $this->assertRaw('group-header', 'Template found (region header)'); $this->assertRaw('group-left', 'Template found (region left)'); $this->assertRaw('group-right', 'Template found (region right)'); $this->assertRaw('group-footer', 'Template found (region footer)'); $this->assertRaw('edit-title', 'Title field found'); $this->assertRaw('edit-submit', 'Submit field found'); $this->assertRaw('edit-field-tags-und', 'Tags field found'); $this->assertRaw('edit-log', 'Revision log found'); } }