$this->
drupalGet($handler_options_path);
$this->
assertSession()->
fieldNotExists($relationship_name);
// Create a view of comments with node relationship.
View::
create(['base_table' => 'comment_field_data', 'id' => 'test_get_entity_type'
])->
save();
$this->
drupalGet('admin/structure/views/nojs/add-handler/test_get_entity_type/default/relationship'
);
$this->
submitForm(['name[comment_field_data.node]' => 'comment_field_data.node'
], 'Add and configure relationships'
);
$this->
submitForm([], 'Apply'
);
// Add a content type filter.
$this->
drupalGet('admin/structure/views/nojs/add-handler/test_get_entity_type/default/filter'
);
$this->
submitForm(['name[node_field_data.type]' => 'node_field_data.type'
], 'Add and configure filter criteria'
);
$this->
assertTrue($this->
assertSession()->
optionExists('edit-options-relationship', 'node'
)->
isSelected());
$this->
submitForm(['options[value][page]' => 'page'
], 'Apply'
);
// Check content type filter options.
$this->
drupalGet('admin/structure/views/nojs/handler/test_get_entity_type/default/filter/type'
);
$this->
assertTrue($this->
assertSession()->
optionExists('edit-options-relationship', 'node'
)->
isSelected());
$this->
assertSession()->
checkboxChecked('edit-options-value-page'
);
} /**
* Tests the relationship method on the base class.
*/
public function testSetRelationship() {