Checks if $paragraph fields match with host / parent.
$paragraph: The paragraph entity to check.
$id: The parent entity id.
$entity_type: The parent entity type.
$field_name: The parent entity field name.
public function assertParagraphField($paragraph, $id, $entity_type, $field_name) {
self::assertEquals($paragraph['parent_id'][0]['value'], $id, 'Match parent id.');
self::assertEquals($paragraph['parent_type'][0]['value'], $entity_type, 'Matching parent type.');
self::assertEquals($paragraph['parent_field_name'][0]['value'], $field_name, 'Matching parent field name.');
}