/**
* Tests the use of field layout for entity form displays.
*/
public function testEntityForm() { // By default, the one-column layout is used.
$this->
drupalGet('entity_test/manage/1/edit'
);
$this->
assertFieldInRegion('field_test_text[0][value]', 'content'
);
// The one-column layout is in use.
$this->
drupalGet('entity_test/structure/entity_test/form-display'
);
$this->
assertEquals(['Content', 'Disabled'
],
$this->
getRegionTitles());
// Switch the layout to two columns.
$this->
click('#edit-field-layouts'
);
$this->
getSession()->
getPage()->
selectFieldOption('field_layout', 'layout_twocol'
);
$this->
assertSession()->
assertWaitOnAjaxRequest();
$this->
submitForm([], 'Save'
);
// The field is moved to the default region for the new layout.
$this->
assertSession()->
pageTextContains('Your settings have been saved.'
);
$this->
assertEquals(['Top', 'First', 'Second', 'Bottom', 'Disabled'
],
$this->
getRegionTitles());