diff --git a/dynamic_entity_reference.views.inc b/dynamic_entity_reference.views.inc
index 7cb6de8..c5cccd0 100644
--- a/dynamic_entity_reference.views.inc
+++ b/dynamic_entity_reference.views.inc
@@ -6,6 +6,9 @@
  */
 
 use Drupal\field\FieldStorageConfigInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\dynamic_entity_reference\Plugin\Field\FieldType\DynamicEntityReferenceItem;
+use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
 
 /**
  * Implements hook_field_views_data().
@@ -98,3 +101,145 @@ function dynamic_entity_reference_field_views_data(FieldStorageConfigInterface $
 
   return $data;
 }
+
+/**
+ * Implements hook_views_data().
+ *
+ * Adds relationships for dynamic_entity_reference base fields.
+ *
+ * @return array
+ */
+function dynamic_entity_reference_views_data() {
+  $entity_manager = \Drupal::entityManager();
+
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
+  $entity_types = [];
+  $sql_entity_types = [];
+  $fields_all = [];
+  // Ensure origin and target entity types are SQL.
+  foreach ($entity_manager->getDefinitions() as $entity_type) {
+    if ($entity_type->hasHandlerClass('views_data') && $entity_manager->getStorage($entity_type->id()) instanceof SqlEntityStorageInterface) {
+      $sql_entity_types[$entity_type->id()] = $entity_type->id();
+      // Only fieldable entities have base fields.
+      if ($entity_type->isSubclassOf('\Drupal\Core\Entity\FieldableEntityInterface')) {
+        $entity_types[$entity_type->id()] = $entity_type;
+        foreach ($entity_manager->getBaseFieldDefinitions($entity_type->id()) as $base_field) {
+          if ($base_field->getType() == 'dynamic_entity_reference') {
+            $fields_all[$entity_type->id()][] = $base_field;
+          }
+        }
+      }
+    }
+  }
+
+  $data = [];
+  foreach ($fields_all as $entity_type_id => $fields) {
+    /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
+    $table_mapping = $entity_manager->getStorage($entity_type_id)->getTableMapping();
+
+    $entity_type = $entity_types[$entity_type_id];
+    $base_table = $entity_type->getDataTable() ?: $entity_type->getBaseTable();
+
+    /** @var BaseFieldDefinition[] $fields */
+    foreach ($fields as $field) {
+      $field_name = $field->getName();
+      $columns = $table_mapping->getColumnNames($field_name);
+      $column_id = $columns['target_id'];
+      $column_type = $columns['target_type'];
+
+      // Unlimited (-1) or > 1 store field data in a dedicated table.
+      $table = $base_table . ($field->getCardinality() != 1 ? '__' . $field_name : '');
+      $targets = array_intersect(DynamicEntityReferenceItem::getTargetTypes($field->getSettings()), array_keys($sql_entity_types));
+      foreach ($targets as $target_entity_type_id) {
+        $target_entity_type = $entity_types[$target_entity_type_id];
+        $target_table = $target_entity_type->getDataTable() ?: $target_entity_type->getBaseTable();
+
+        $t_args = [
+          '@origin_label' => $entity_type->getLabel(),
+          '@target_label' => $target_entity_type->getLabel(),
+          '@field_name' => $field->getLabel() ?: $field_name,
+          '@type' => 'base field',
+        ];
+
+        // Relationship (Origin -> Target)
+        $psuedo_field = $target_entity_type_id . '__' . $field_name;
+        $data[$table][$psuedo_field]['relationship'] = [
+          'title' => t('@field_name to @target_label entities', $t_args),
+          'label' => t('@field_name: @target_label', $t_args),
+          'group' => $entity_type->getLabel(),
+          'help' => t('References to @target_label entities referenced by @field_name @type on @origin_label entities.', $t_args),
+          'id' => 'standard',
+          'base' => $target_table,
+          'entity type' => $target_entity_type_id,
+          'base field' => $target_entity_type->getKey('id'),
+          'relationship field' => $column_id,
+          'extra' => [
+            [
+              // Entity reference field only has one target type whereas dynamic
+              // entity reference field can have multiple target types that is
+              // why we need extra join condition on target types.
+              'left_field' => $column_type,
+              'value' => $target_entity_type_id,
+            ],
+          ],
+        ];
+
+        // Reverse Relationship (Target -> Origin)
+        $psuedo_field = 'reverse__' . $entity_type_id . '__'. $field_name;
+        $relationship = [
+          'title' => t('Reverse reference to @field_name @type on @origin_label', $t_args),
+          'label' => t('Reverse reference to @field_name @type on @origin_label', $t_args),
+          'group' => $target_entity_type->getLabel(),
+          'help' =>  t('Reverse reference from @target_label entities referenced by @field_name @type on @origin_label entities.', $t_args),
+        ];
+        // When base field cardinality is 1 then the 'base' and 'field table'
+        // are same because field column(s) exist in entity base table therefore
+        // we can't use entity_reverse relationship plugin.
+        if ($field->getCardinality() == 1) {
+          $data[$target_table][$psuedo_field]['relationship'] = [
+            'id' => 'standard',
+            'base' => $table,
+            'entity type' => $entity_type_id,
+            'base field' => $column_id,
+            'relationship field' => $entity_type->getKey('id'),
+            'extra' => [
+              [
+                // Entity reference field only has one target type whereas dynamic
+                // entity reference field can have multiple target types that is
+                // why we need extra join condition on target types.
+                'field' => $column_type,
+                'value' => $target_entity_type_id,
+              ],
+            ],
+          ];
+        }
+        // When base field cardinality is greater then 1 the 'base' and
+        // 'field table' are not same because field column(s) exist in separate
+        // table therefore we have to use entity_reverse relationship plugin.
+        else {
+          $data[$target_table][$psuedo_field]['relationship'] = [
+            'id' => 'entity_reverse',
+            'base' => $base_table,
+            'entity_type' => $entity_type_id,
+            'base field' => $entity_type->getKey('id'),
+            'field_name' => $field_name,
+            'field table' => $table,
+            'field field' => $column_id,
+            // Entity reference field only has one target type whereas dynamic
+            // entity reference field can have multiple target types that is why
+            // we need extra join condition on target types.
+            'join_extra' => [
+              [
+                'field' => $column_type,
+                'value' => $target_entity_type_id,
+              ],
+            ],
+          ];
+        }
+        $data[$target_table][$psuedo_field]['relationship'] += $relationship;
+      }
+    }
+  }
+
+  return $data;
+}
diff --git a/src/Tests/Views/DynamicEntityReferenceBaseFieldRelationshipTest.php b/src/Tests/Views/DynamicEntityReferenceBaseFieldRelationshipTest.php
new file mode 100644
index 0000000..8973de0
--- /dev/null
+++ b/src/Tests/Views/DynamicEntityReferenceBaseFieldRelationshipTest.php
@@ -0,0 +1,329 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\dynamic_entity_reference\Tests\Views\DynamicEntityReferenceBaseFieldRelationshipTest.
+ */
+
+namespace Drupal\dynamic_entity_reference\Tests\Views;
+
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\entity_test\Entity\EntityTest;
+use Drupal\entity_test\Entity\EntityTestMul;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\views\Tests\ViewKernelTestBase;
+use Drupal\views\Tests\ViewTestData;
+use Drupal\views\Views;
+
+/**
+ * Tests dynamic entity reference relationship data for base fields.
+ *
+ * @group dynamic_entity_reference
+ * @see dynamic_entity_reference_views_data()
+ */
+class DynamicEntityReferenceBaseFieldRelationshipTest extends ViewKernelTestBase {
+
+  /**
+   * Views used by this test.
+   *
+   * @var array
+   */
+  public static $testViews = [
+//    'test_dynamic_entity_reference_entity_test_view',
+//    'test_dynamic_entity_reference_entity_test_mul_view',
+//    'test_dynamic_entity_reference_entity_test_rev_view',
+  ];
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = array('user', 'field', 'entity_test', 'entity_reference', 'dynamic_entity_reference', 'dynamic_entity_reference_entity_test');
+
+  /**
+   * The entity_test entities used by the test.
+   *
+   * @var array
+   */
+  protected $entities = array();
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->installEntitySchema('user');
+    $this->installEntitySchema('entity_test');
+    $this->installEntitySchema('entity_test_mul');
+
+    ViewTestData::createTestViews(get_class($this), array('dynamic_entity_reference_entity_test'));
+  }
+
+  /**
+   * Tests views der base field relationship with single referenced entities.
+   */
+  public function testSingleBaseFieldRelationship() {
+    // Create some test entities which link each other.
+    $referenced_entity = EntityTest::create();
+    $referenced_entity->save();
+    $referenced_entity_mul = EntityTestMul::create();
+    $referenced_entity_mul->save();
+
+    $entity = EntityTest::create();
+    $entity->dynamic_references[] = $referenced_entity;
+    $entity->dynamic_references[] = $referenced_entity_mul;
+    $entity->save();
+    $this->assertEqual($entity->dynamic_references[0]->entity->id(), $referenced_entity->id());
+    $this->assertEqual($entity->dynamic_references[1]->entity->id(), $referenced_entity_mul->id());
+    $this->entities[] = $entity;
+
+    $entity = EntityTest::create();
+    $entity->dynamic_references[] = $referenced_entity;
+    $entity->dynamic_references[] = $referenced_entity_mul;
+    $entity->save();
+    $this->assertEqual($entity->dynamic_references[0]->entity->id(), $referenced_entity->id());
+    $this->assertEqual($entity->dynamic_references[1]->entity->id(), $referenced_entity_mul->id());
+    $this->entities[] = $entity;
+
+    Views::viewsData()->clear();
+
+    // Check just the generated views data.
+    $views_data_entity_test = Views::viewsData()->get('entity_test');
+
+    // Check views data for test entity referenced from dynamic_references.
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['base'], 'entity_test');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['entity type'], 'entity_test');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['relationship field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['extra'][0]['left_field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test');
+    // Check views data for test entity - data table referenced from dynamic_references.
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['entity type'], 'entity_test_mul');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['relationship field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['extra'][0]['left_field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test_mul');
+    // Check the backwards reference for test entity using dynamic_references.
+    $this->assertEqual($views_data_entity_test['reverse__entity_test__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test__dynamic_references']['relationship']['base'], 'entity_test');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test__dynamic_references']['relationship']['entity type'], 'entity_test');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test__dynamic_references']['relationship']['base field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test__dynamic_references']['relationship']['relationship field'], 'id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test__dynamic_references']['relationship']['extra'][0]['field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test');
+    // Check the backwards reference for test entity - data table using dynamic_references.
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['entity type'], 'entity_test_mul');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['base field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['relationship field'], 'id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['extra'][0]['field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test');
+
+    // Check just the generated views data.
+    $views_data_entity_test_mul = Views::viewsData()->get('entity_test_mul_property_data');
+
+    // Check views data for test entity referenced from dynamic_references.
+    $this->assertEqual($views_data_entity_test_mul['entity_test__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test_mul['entity_test__dynamic_references']['relationship']['base'], 'entity_test');
+    $this->assertEqual($views_data_entity_test_mul['entity_test__dynamic_references']['relationship']['entity type'], 'entity_test');
+    $this->assertEqual($views_data_entity_test_mul['entity_test__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test_mul['entity_test__dynamic_references']['relationship']['relationship field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test_mul['entity_test__dynamic_references']['relationship']['extra'][0]['left_field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test_mul['entity_test__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test');
+    // Check views data for test entity - data table referenced from dynamic_references.
+    $this->assertEqual($views_data_entity_test_mul['entity_test_mul__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test_mul['entity_test_mul__dynamic_references']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test_mul['entity_test_mul__dynamic_references']['relationship']['entity type'], 'entity_test_mul');
+    $this->assertEqual($views_data_entity_test_mul['entity_test_mul__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test_mul['entity_test_mul__dynamic_references']['relationship']['relationship field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test_mul['entity_test_mul__dynamic_references']['relationship']['extra'][0]['left_field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test_mul['entity_test_mul__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test_mul');
+    // Check the backwards reference for test entity using dynamic_references.
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test__dynamic_references']['relationship']['base'], 'entity_test');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test__dynamic_references']['relationship']['entity type'], 'entity_test');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test__dynamic_references']['relationship']['base field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test__dynamic_references']['relationship']['relationship field'], 'id');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test__dynamic_references']['relationship']['extra'][0]['field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test_mul');
+    // Check the backwards reference for test entity - data table using dynamic_references.
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test_mul__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test_mul__dynamic_references']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test_mul__dynamic_references']['relationship']['entity type'], 'entity_test_mul');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test_mul__dynamic_references']['relationship']['base field'], 'dynamic_references__target_id');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test_mul__dynamic_references']['relationship']['relationship field'], 'id');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test_mul__dynamic_references']['relationship']['extra'][0]['field'], 'dynamic_references__target_type');
+    $this->assertEqual($views_data_entity_test_mul['reverse__entity_test_mul__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test_mul');
+/*
+    // Check an actual test view.
+    $view = Views::getView('test_dynamic_entity_reference_entity_test_view');
+    $this->executeView($view);
+
+    foreach ($view->result as $index => $row) {
+      // Just check that the actual ID of the entity is the expected one.
+      $this->assertEqual($row->id, $this->entities[$index ]->id());
+      // Also check that we have the correct result entity.
+      $this->assertEqual($row->_entity->id(), $this->entities[$index]->id());
+      $this->assertEqual($row->_entity->bundle(), $this->entities[$index]->bundle());
+      // Test the relationship.
+      $this->assertEqual($row->entity_test_entity_test__dynamic_references_id, 1);
+
+      // Test that the correct relationship entity is on the row.
+      $this->assertEqual($row->_relationship_entities['entity_test__dynamic_references']->id(), 1);
+      $this->assertEqual($row->_relationship_entities['entity_test__dynamic_references']->bundle(), 'entity_test');
+    }
+
+    $view->destroy();
+    $view->setDisplay('embed_1');
+    $this->executeView($view);
+
+    foreach ($view->result as $index => $row) {
+      // Just check that the actual ID of the entity is the expected one.
+      $this->assertEqual($row->id, $this->entities[$index]->id());
+      // Also check that we have the correct result entity.
+      $this->assertEqual($row->_entity->id(), $this->entities[$index]->id());
+      $this->assertEqual($row->_entity->bundle(), $this->entities[$index]->bundle());
+      // Test the relationship.
+      $this->assertEqual($row->entity_test_mul_property_data_entity_test__dynamic_references_id, 1);
+
+      // Test that the correct relationship entity is on the row.
+      $this->assertEqual($row->_relationship_entities['entity_test_mul__dynamic_references']->id(), 1);
+      $this->assertEqual($row->_relationship_entities['entity_test_mul__dynamic_references']->bundle(), 'entity_test_mul');
+    }*/
+  }
+
+  /**
+   * Tests views der base field relationship with multiple referenced entities.
+   */
+  public function testMultiBaseFieldRelationship() {
+    $entity_manager = \Drupal::entityManager();
+    $this->assertEqual($entity_manager->getBaseFieldDefinitions('entity_test')['dynamic_references']->getCardinality(), 1);
+    $this->assertEqual($entity_manager->getBaseFieldDefinitions('entity_test_mul')['dynamic_references']->getCardinality(), 1);
+    // Update definitions and schema.
+    $manager = \Drupal::entityDefinitionUpdateManager();
+    $storage_definition = $manager->getFieldStorageDefinition('dynamic_references', 'entity_test');
+    $storage_definition->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
+    $manager->updateFieldStorageDefinition($storage_definition);
+    $storage_definition = $manager->getFieldStorageDefinition('dynamic_references', 'entity_test_mul');
+    $storage_definition->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
+    $manager->updateFieldStorageDefinition($storage_definition);
+
+    $this->assertEqual($entity_manager->getBaseFieldDefinitions('entity_test')['dynamic_references']->getCardinality(), FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
+    $this->assertEqual($entity_manager->getBaseFieldDefinitions('entity_test_mul')['dynamic_references']->getCardinality(), FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
+
+    // Create some test entities which link each other.
+    $referenced_entity = EntityTest::create();
+    $referenced_entity->save();
+    $referenced_entity_mul = EntityTestMul::create();
+    $referenced_entity_mul->save();
+
+    $entity = EntityTestMul::create();
+    $entity->dynamic_references[] = $referenced_entity;
+    $entity->dynamic_references[] = $referenced_entity_mul;
+    $entity->save();
+    $this->assertEqual($entity->dynamic_references[0]->entity->id(), $referenced_entity->id());
+    $this->assertEqual($entity->dynamic_references[1]->entity->id(), $referenced_entity_mul->id());
+    $this->entities[] = $entity;
+
+    $entity = EntityTestMul::create();
+    $entity->dynamic_references[] = $referenced_entity;
+    $entity->dynamic_references[] = $referenced_entity_mul;
+    $entity->save();
+    $this->assertEqual($entity->dynamic_references[0]->entity->id(), $referenced_entity->id());
+    $this->assertEqual($entity->dynamic_references[1]->entity->id(), $referenced_entity_mul->id());
+    $this->entities[] = $entity;
+
+    Views::viewsData()->clear();
+/*
+    // Check just the generated views data.
+    $views_data_entity_test = Views::viewsData()->get('entity_test_mul__dynamic_references');
+
+    // Check views data for test entity referenced from dynamic_references.
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['base'], 'entity_test');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['entity type'], 'entity_test');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['relationship field'], 'dynamic_references_target_id');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['extra'][0]['left_field'], 'dynamic_references_target_type');
+    $this->assertEqual($views_data_entity_test['entity_test__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test');
+
+    // Check views data for test entity - data table referenced from
+    // dynamic_references.
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['entity type'], 'entity_test_mul');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['relationship field'], 'dynamic_references_target_id');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['extra'][0]['left_field'], 'dynamic_references_target_type');
+    $this->assertEqual($views_data_entity_test['entity_test_mul__dynamic_references']['relationship']['extra'][0]['value'], 'entity_test_mul');
+
+    // Check the backwards reference for test entity using dynamic_references.
+    $views_data_entity_test = Views::viewsData()->get('entity_test');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['id'], 'entity_reverse');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['field table'], 'entity_test_mul__dynamic_references');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['field field'], 'dynamic_references_target_id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][0]['field'], 'dynamic_references_target_type');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][0]['value'], 'entity_test');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][1]['field'], 'deleted');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][1]['value'], 0);
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][1]['numeric'], TRUE);
+
+    // Check the backwards reference for test entity - data table using
+    // dynamic_references.
+    $views_data_entity_test = Views::viewsData()->get('entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['id'], 'entity_reverse');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['field table'], 'entity_test_mul__dynamic_references');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['field field'], 'dynamic_references_target_id');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][0]['field'], 'dynamic_references_target_type');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][0]['value'], 'entity_test_mul');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][1]['field'], 'deleted');
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][1]['value'], 0);
+    $this->assertEqual($views_data_entity_test['reverse__entity_test_mul__dynamic_references']['relationship']['join_extra'][1]['numeric'], TRUE);
+*//*
+    // Check an actual test view.
+    $view = Views::getView('test_dynamic_entity_reference_entity_test_mul_view');
+    $this->executeView($view);
+
+    foreach ($view->result as $index => $row) {
+      $this->assertEqual($row->id, 1);
+      $this->assertEqual($row->_entity->id(), 1);
+      $this->assertEqual($row->_entity->bundle(), 'entity_test_mul');
+
+      // Test the backwards relationship.
+      $this->assertEqual($row->dynamic_references_entity_test_mul_property_data_id, $this->entities[$index]->id());
+
+      // Test that the correct relationship entity is on the row.
+      $this->assertEqual($row->_relationship_entities['reverse__entity_test_mul__dynamic_references']->id(), $this->entities[$index]->id());
+      $this->assertEqual($row->_relationship_entities['reverse__entity_test_mul__dynamic_references']->bundle(), 'entity_test_mul');
+
+    }
+
+    $view = Views::getView('test_dynamic_entity_reference_entity_test_rev_view');
+    $this->executeView($view);
+
+    foreach ($view->result as $index => $row) {
+      $this->assertEqual($row->id, 1);
+      $this->assertEqual($row->_entity->id(), 1);
+      $this->assertEqual($row->_entity->bundle(), 'entity_test');
+
+      // Test the backwards relationship.
+      $this->assertEqual($row->dynamic_references_entity_test_id, $this->entities[$index]->id());
+
+      // Test that the correct relationship entity is on the row.
+      $this->assertEqual($row->_relationship_entities['reverse__entity_test_mul__dynamic_references']->id(), $this->entities[$index]->id());
+      $this->assertEqual($row->_relationship_entities['reverse__entity_test_mul__dynamic_references']->bundle(), 'entity_test_mul');
+    }*/
+  }
+
+}
diff --git a/src/Tests/Views/DynamicEntityReferenceRelationshipTest.php b/src/Tests/Views/DynamicEntityReferenceRelationshipTest.php
index 701f042..4de100c 100644
--- a/src/Tests/Views/DynamicEntityReferenceRelationshipTest.php
+++ b/src/Tests/Views/DynamicEntityReferenceRelationshipTest.php
@@ -40,7 +40,7 @@ class DynamicEntityReferenceRelationshipTest extends ViewKernelTestBase {
    *
    * @var array
    */
-  public static $modules = array('user', 'field', 'entity_test', 'options', 'entity_reference', 'dynamic_entity_reference', 'dynamic_entity_reference_test_views');
+  public static $modules = array('user', 'field', 'entity_test', 'entity_reference', 'dynamic_entity_reference', 'dynamic_entity_reference_test_views');
 
   /**
    * The entity_test entities used by the test.
diff --git a/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.info.yml b/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.info.yml
new file mode 100644
index 0000000..740ad89
--- /dev/null
+++ b/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.info.yml
@@ -0,0 +1,8 @@
+name: 'Dynamic Entity Reference Entity Test'
+type: module
+description: 'Provides base fields for dynamic_entity_reference tests of entity_test entity type.'
+package: Testing
+core: 8.x
+dependencies:
+  - dynamic_entity_reference
+  - entity_test
diff --git a/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.module b/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.module
new file mode 100644
index 0000000..bed98f9
--- /dev/null
+++ b/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.module
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * @file
+ * Module file for dynamic_entity_reference_entity_test.
+ */
+
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+
+/**
+ * Implements hook_entity_base_field_info().
+ */
+function dynamic_entity_reference_entity_test_entity_base_field_info(EntityTypeInterface $entity_type) {
+  $fields = [];
+  // 'entity_test' with no data table and 'entity_test_mul' is with data table.
+  if ($entity_type->id() == 'entity_test' || $entity_type->id() == 'entity_test_mul') {
+    $fields['dynamic_references'] = BaseFieldDefinition::create('dynamic_entity_reference')
+      ->setLabel(t('References'))
+      ->setDescription(t('Reference another entity.'))
+      ->setRequired(FALSE)
+      ->setCardinality(1)
+      ->setSettings([
+        'exclude_entity_types' => FALSE,
+        'entity_type_ids' => [
+          'entity_test' => 'entity_test',
+          'entity_test_mul' => 'entity_test_mul',
+        ],
+        'entity_test' => [
+          'handler' => "default:entity_test",
+          'handler_settings' => [],
+        ],
+        'entity_test_mul' => [
+          'handler' => "default:entity_test_mul",
+          'handler_settings' => [],
+        ],
+      ])
+      ->setDisplayOptions('form', [
+        'type' => 'dynamic_entity_reference_default',
+        'weight' => 10,
+      ])
+      ->setDisplayOptions('view', [
+        'label' => 'above',
+        'type' => 'dynamic_entity_reference_label',
+        'weight' => 10,
+      ])
+      ->setDisplayConfigurable('form', TRUE)
+      ->setDisplayConfigurable('view', TRUE);
+  }
+
+  return $fields;
+}
diff --git a/tests/modules/dynamic_entity_reference_test_views/dynamic_entity_reference_test_views.info.yml b/tests/modules/dynamic_entity_reference_test_views/dynamic_entity_reference_test_views.info.yml
index f9eb684..0d16eef 100644
--- a/tests/modules/dynamic_entity_reference_test_views/dynamic_entity_reference_test_views.info.yml
+++ b/tests/modules/dynamic_entity_reference_test_views/dynamic_entity_reference_test_views.info.yml
@@ -4,5 +4,5 @@ description: 'Provides default views for views dynamic entity reference tests.'
 package: Testing
 core: 8.x
 dependencies:
- - dynamic_entity_reference
- - views
+  - dynamic_entity_reference
+  - views
diff --git a/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_mul_view.yml b/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_mul_view.yml
index d356d0a..76bac5d 100644
--- a/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_mul_view.yml
+++ b/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_mul_view.yml
@@ -1,4 +1,3 @@
-uuid: 1e61d181-8c81-4fd8-a014-20697be0c539
 langcode: en
 status: true
 dependencies:
diff --git a/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_rev_view.yml b/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_rev_view.yml
index 11ec608..cdcf916 100644
--- a/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_rev_view.yml
+++ b/tests/modules/dynamic_entity_reference_test_views/test_views/views.view.test_dynamic_entity_reference_entity_test_rev_view.yml
@@ -1,4 +1,3 @@
-uuid: 7f32622a-dd7c-4a3a-a554-84b8dfc394b3
 langcode: en
 status: true
 dependencies:
