'name' => 'bundle_referenced',
]);
$this->
createEntityReferenceField('node', 'bundle_with_reference_field', 'field_reference', 'Reference field', 'node', 'default',
[ 'target_bundles' =>
['bundle_referenced'
],
]);
// Enable layout builder to the content type with the reference field, and
// add the reference field to the layout builder display.
$this->container->
get('entity_display.repository'
) ->
getViewDisplay('node', 'bundle_with_reference_field', 'full'
) ->
enableLayoutBuilder() ->
setComponent('field_reference',
['type' => 'entity_reference_label'
]) ->
save();
} /**
* Tests cache tags on field block for entity reference field.
*/
public function testEntityReferenceFieldBlockCaching() { $assert_session =
$this->
assertSession();
// Create two nodes, one of the referenced content type and one of the