'name' => 'name',
$this->fieldName => 'some_text',
])->
save();
} /**
* Tests the entity reference display plugin.
*/
public function testEntityReferenceDisplay() { // Test that the 'title' settings are not shown.
$this->
drupalGet('admin/structure/views/view/test_display_entity_reference/edit/entity_reference_1'
);
$this->
assertSession()->
linkByHrefNotExists('admin/structure/views/nojs/display/test_display_entity_reference/entity_reference_1/title'
);
// Add the new field to the fields.
$this->
drupalGet('admin/structure/views/nojs/add-handler/test_display_entity_reference/default/field'
);
$this->
submitForm([ 'name[entity_test__' .
$this->fieldName . '.' .
$this->fieldName . ']' => TRUE,
], 'Add and configure fields'
);
$this->
submitForm([], 'Apply'
);
// Test that the right fields are shown on the display settings form.
$this->
drupalGet('admin/structure/views/nojs/display/test_display_entity_reference/entity_reference_1/style_options'
);
$this->
assertSession()->
pageTextContains('Test entity: Name'
);