diff --git a/src/Plugin/Field/FieldType/DynamicEntityReferenceFieldItemList.php b/src/Plugin/Field/FieldType/DynamicEntityReferenceFieldItemList.php
index da49c9d..6649c99 100644
--- a/src/Plugin/Field/FieldType/DynamicEntityReferenceFieldItemList.php
+++ b/src/Plugin/Field/FieldType/DynamicEntityReferenceFieldItemList.php
@@ -6,6 +6,7 @@ use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraint;
 use Drupal\Core\Field\EntityReferenceFieldItemList;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemList;
 use Drupal\Core\Form\FormStateInterface;
 
 /**
@@ -30,6 +31,7 @@ class DynamicEntityReferenceFieldItemList extends EntityReferenceFieldItemList {
     }
     $constraints = array_values($constraints);
     $constraint_manager = $this->getTypedDataManager()->getValidationConstraintManager();
+    $constraints[] = $constraint_manager->create('ValidDynamicReference', []);
     return $constraints;
   }
 
diff --git a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
index 775d420..854bf1d 100644
--- a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
+++ b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
@@ -34,8 +34,7 @@ use Drupal\dynamic_entity_reference\DataDynamicReferenceDefinition;
  *   no_ui = FALSE,
  *   list_class = "\Drupal\dynamic_entity_reference\Plugin\Field\FieldType\DynamicEntityReferenceFieldItemList",
  *   default_widget = "dynamic_entity_reference_default",
- *   default_formatter = "dynamic_entity_reference_label",
- *   constraints = {"ValidDynamicReference" = {}}
+ *   default_formatter = "dynamic_entity_reference_label"
  * )
  */
 class DynamicEntityReferenceItem extends EntityReferenceItem {
diff --git a/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraint.php b/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraint.php
index 6661c17..a6ce9b2 100644
--- a/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraint.php
+++ b/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraint.php
@@ -21,7 +21,49 @@ class ValidDynamicReferenceConstraint extends Constraint {
    *
    * @var string
    */
-  public $message = 'The referenced entity (%type: %id) does not exist.';
+  public $message = 'This entity (%type: %id) cannot be referenced.';
+
+  /**
+   * Violation message when the entity does not exist.
+   *
+   * @var string
+   */
+  public $nonExistingMessage = 'The referenced entity (%type: %id) does not exist.';
+
+  /**
+   * Violation message when a new entity ("autocreate") is invalid.
+   *
+   * @var string
+   */
+  public $invalidAutocreateMessage = 'This entity (%type: %label) cannot be referenced.';
+
+  /**
+   * The default violation message.
+   *
+   * @var string
+   */
+  public $wrongIDMessage = 'The referenced entity (%type: %id) does not exist.';
+
+  /**
+   * Validation message when the entity type is not supported.
+   *
+   * @var string
+   */
+  public $wrongTypeMessage = 'The referenced entity type (%type) is not allowed for this field.';
+
+  /**
+   * Validation message when bundle is not supported.
+   *
+   * @var string
+   */
+  public $wrongBundleMessage = 'Referenced entity %label does not belong to one of the supported bundles (%bundles).';
+
+  /**
+   * Validate message if no bundle is allowed.
+   *
+   * @var string
+   */
+  public $noBundleAllowed = 'No bundle is allowed for (%type)';
 
   /**
    * Validation message when the target_id or target_type is empty.
diff --git a/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php b/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php
index b369545..f8b4b75 100644
--- a/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php
@@ -2,49 +2,197 @@
 
 namespace Drupal\dynamic_entity_reference\Plugin\Validation\Constraint;
 
+use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface;
+use Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\dynamic_entity_reference\Plugin\Field\FieldType\DynamicEntityReferenceItem;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\ConstraintValidator;
 
 /**
  * Checks if referenced entities are valid.
  */
-class ValidDynamicReferenceConstraintValidator extends ConstraintValidator {
+class ValidDynamicReferenceConstraintValidator extends ConstraintValidator implements ContainerInjectionInterface {
+
+  /**
+   * The selection plugin manager.
+   *
+   * @var \Drupal\dynamic_entity_reference\SelectionPluginManager
+   */
+  protected $selectionManager;
+
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * Constructs a ValidReferenceConstraintValidator object.
+   *
+   * @param \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface $selection_manager
+   *   The selection plugin manager.
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The entity type manager.
+   */
+  public function __construct(SelectionPluginManagerInterface $selection_manager, EntityTypeManagerInterface $entity_type_manager) {
+    $this->selectionManager = $selection_manager;
+    $this->entityTypeManager = $entity_type_manager;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('plugin.manager.dynamic_entity_reference_selection'),
+      $container->get('entity_type.manager')
+    );
+  }
 
   /**
    * {@inheritdoc}
    */
   public function validate($value, Constraint $constraint) {
-    /* @var \Drupal\Core\Field\FieldItemInterface $value */
+    /* @var \Drupal\dynamic_entity_reference\Plugin\Validation\Constraint\ValidDynamicReferenceConstraint $constraint */
+    /* @var \Drupal\Core\Field\FieldItemListInterface $value */
     if (!isset($value)) {
       return;
     }
-    // We don't use a regular NotNull constraint for the target_id property as
-    // a NULL value is valid if the entity property contains an unsaved entity.
-    // @see \Drupal\Core\TypedData\DataReferenceTargetDefinition::getConstraints
-    if (!$value->isEmpty() && $value->target_id === NULL && !$value->entity->isNew()) {
-      $this->context->addViolation($constraint->nullMessage, ['%property' => 'target_id']);
-      return;
+
+    // Collect new entities, IDs and target types of existing entities across
+    // the field items.
+    $new_entities = [];
+    $target_ids = [];
+    $target_types = [];
+    $valid_target_types = DynamicEntityReferenceItem::getTargetTypes($value->getFieldDefinition()->getSettings());
+    foreach ($value as $delta => $item) {
+      // We don't use a regular NotNull constraint for the target_id property as
+      // NULL is allowed if the entity property contains an unsaved entity.
+      // @see \Drupal\Core\TypedData\DataReferenceTargetDefinition::getConstraints()
+      if (!$item->isEmpty() && ($item->target_id === NULL || $item->target_type === NULL)) {
+        $property = $item->target_id ? 'target_type' : 'target_id';
+        if (!$item->entity->isNew()) {
+          $this->context->buildViolation($constraint->nullMessage)
+            ->setParameter('%property', $property)
+            ->atPath((string) $delta . '.' . $property)
+            ->addViolation();
+          continue;
+        }
+        $new_entities[$delta] = $item->entity;
+      }
+
+      // Validate target type.
+      $valid_type = empty($item->target_type) || (!empty($item->target_type) && in_array($item->target_type, $valid_target_types));
+      if (!$valid_type) {
+        // Remove new entity if the target type is not valid.
+        if (isset($new_entities[$delta])) {
+          unset($new_entities[$delta]);
+        }
+        $this->context->buildViolation($constraint->wrongTypeMessage)
+          ->setParameter('%type', $item->target_type)
+          ->atPath((string) $delta . '.target_type')
+          ->setInvalidValue($item->target_type)
+          ->addViolation();
+        continue;
+      }
+
+      // '0' or NULL are considered valid empty references.
+      if (!empty($item->target_id)) {
+        $target_ids[$delta] = $item->target_id;
+      }
+      $target_types[$delta] = $item->target_type;
     }
-    // We don't use a regular NotNull constraint for the target_id property as
-    // a NULL value is valid if the entity property contains an unsaved entity.
-    // @see \Drupal\Core\TypedData\DataReferenceTargetDefinition::getConstraints
-    if (!$value->isEmpty() && $value->target_type === NULL && !$value->entity->isNew()) {
-      $this->context->addViolation($constraint->nullMessage, ['%property' => 'target_type']);
-      return;
+
+    // Collect all new and created valid entities fot bundle validation.
+    $valid_entities = [];
+
+    // Validate new entities.
+    foreach ($new_entities as $delta => $new_entity) {
+      /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
+      $handler = $this->selectionManager->getSelectionHandler($value->getFieldDefinition(), NULL, $target_types[$delta]);
+      if ($handler instanceof SelectionWithAutocreateInterface && ($new_entity->getEntityTypeId() == $target_types[$delta] || empty($target_types[$delta]))) {
+        if (!$handler->validateReferenceableNewEntities([$new_entity])) {
+          $this->context->buildViolation($constraint->invalidAutocreateMessage)
+            ->setParameter('%type', $new_entity->getEntityTypeId())
+            ->setParameter('%label', $new_entity->label())
+            ->atPath((string) $delta . '.entity')
+            ->setInvalidValue($new_entity)
+            ->addViolation();
+          continue;
+        }
+      }
+      $valid_entities[$delta] = $new_entity;
     }
-    $id = $value->get('target_id')->getValue();
-    $type = $value->get('target_type')->getValue();
-    $types = DynamicEntityReferenceItem::getTargetTypes($value->getFieldDefinition()->getSettings());
-    $valid_type = empty($type) || (!empty($type) && in_array($type, $types));
-    // '0' or NULL are considered valid empty references.
-    if (empty($id) && $valid_type) {
-      return;
+
+    // Validate id for non existent entities.
+    foreach ($target_ids as $delta => $target_id) {
+      $definition = $this->entityTypeManager->getDefinition($target_types[$delta]);
+      $existing_id = $this->entityTypeManager->getStorage($target_types[$delta])->getQuery()
+        ->condition($definition->getKey('id'), $target_id, 'IN')
+        ->execute();
+      if (!$existing_id) {
+        $this->context->buildViolation($constraint->nonExistingMessage)
+          ->setParameter('%type', $target_types[$delta])
+          ->setParameter('%id', $target_id)
+          ->atPath((string) $delta . '.target_id')
+          ->setInvalidValue($target_id)
+          ->addViolation();
+        unset($target_ids[$delta]);
+        continue;
+      }
+      $valid_entities[$delta] = $this->entityTypeManager->getStorage($target_types[$delta])->load($target_id);
     }
-    $referenced_entity = $value->get('entity')->getValue();
-    /** @var \Drupal\dynamic_entity_reference\Plugin\Validation\Constraint\ValidDynamicReferenceConstraint $constraint */
-    if (!$valid_type || !$referenced_entity) {
-      $this->context->addViolation($constraint->message, ['%type' => $type, '%id' => $id]);
+
+    // Validate bundles.
+    foreach ($valid_entities as $delta => $entity) {
+      if (array_key_exists('target_bundles', $value->getFieldDefinition()->getSetting($target_types[$delta])['handler_settings'])) {
+        $valid_bundle = FALSE;
+        $target_bundles = $value->getFieldDefinition()->getSetting($target_types[$delta])['handler_settings']['target_bundles'];
+        if ($target_bundles === []) {
+          $this->context->buildViolation($constraint->noBundleAllowed)
+            ->setParameter('%type', $target_types[$delta])
+            ->atPath((string) $delta . '.entity')
+            ->setInvalidValue($entity)
+            ->addViolation();
+          if (isset($target_ids[$delta])) {
+            unset($target_ids[$delta]);
+          }
+          continue;
+        }
+        if ($target_bundles === NULL || in_array($entity->bundle(), $target_bundles)) {
+          $valid_bundle = TRUE;
+        }
+        if (!$valid_bundle) {
+          $this->context->buildViolation($constraint->wrongBundleMessage)
+            ->setParameter('%label', $entity->label())
+            ->setParameter('%bundles', implode(', ', $target_bundles))
+            ->atPath((string) $delta . '.entity')
+            ->setInvalidValue($entity)
+            ->addViolation();
+          if (isset($target_ids[$delta])) {
+            unset($target_ids[$delta]);
+          }
+        }
+      }
+    }
+
+    // Validate target ids.
+    foreach ($target_ids as $delta => $id) {
+      $handler = $this->selectionManager->getSelectionHandler($value->getFieldDefinition(), NULL, $target_types[$delta]);
+      $valid_target_id = $handler->validateReferenceableEntities([$id]);
+      if (!$valid_target_id) {
+        $this->context->buildViolation($constraint->message)
+          ->setParameter('%type', $target_types[$delta])
+          ->setParameter('%id', $id)
+          ->atPath((string) $delta . '.target_id')
+          ->setInvalidValue($id)
+          ->addViolation();
+      }
     }
   }
 
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
index cf80cbe..27d08e7 100644
--- 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
@@ -29,9 +29,7 @@ function dynamic_entity_reference_entity_test_entity_base_field_info(EntityTypeI
           $entity_type_id => [
             'handler' => "default:$entity_type_id",
             'handler_settings' => [
-              'target_bundles' => [
-                $entity_type_id => $entity_type_id,
-              ],
+              'target_bundles' => NULL,
             ],
           ],
         ];
diff --git a/tests/src/Kernel/DynamicEntityReferenceBaseFieldRevisionTest.php b/tests/src/Kernel/DynamicEntityReferenceBaseFieldRevisionTest.php
index 3e0cfe3..03d3820 100644
--- a/tests/src/Kernel/DynamicEntityReferenceBaseFieldRevisionTest.php
+++ b/tests/src/Kernel/DynamicEntityReferenceBaseFieldRevisionTest.php
@@ -101,7 +101,7 @@ class DynamicEntityReferenceBaseFieldRevisionTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->target_id = $referenced_entity->id();
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $this->entityType, '%id' => $referenced_entity->id()]));
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $entity->getEntityTypeId()]));
 
     // Test an invalid entity.
     $entity = $entity_type_manager
@@ -110,7 +110,7 @@ class DynamicEntityReferenceBaseFieldRevisionTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->entity = $entity;
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $this->entityType, '%id' => NULL]));
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $entity->getEntityTypeId()]));
 
     // @todo Implement a test case for invalid bundle references after
     // https://drupal.org/node/2064191 is fixed
@@ -366,7 +366,7 @@ class DynamicEntityReferenceBaseFieldRevisionTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->target_id = $referenced_entity->id();
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $this->entityType, '%id' => $referenced_entity->id()]));
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $entity->getEntityTypeId()]));
 
     // Test an invalid entity.
     $entity = $entity_type_manager
@@ -375,7 +375,7 @@ class DynamicEntityReferenceBaseFieldRevisionTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->entity = $entity;
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $this->entityType, '%id' => NULL]));
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $entity->getEntityTypeId()]));
 
     // @todo Implement a test case for invalid bundle references after
     // https://drupal.org/node/2064191 is fixed
diff --git a/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php b/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php
index 3bdc488..ef4b59b 100644
--- a/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php
+++ b/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php
@@ -101,8 +101,7 @@ class DynamicEntityReferenceBaseFieldTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->target_id = $referenced_entity->id();
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $this->entityType, '%id' => $referenced_entity->id()]));
-
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $entity->getEntityTypeId()]));
     // Test an invalid entity.
     $entity = $entity_type_manager
       ->getStorage($this->entityType)
@@ -110,7 +109,7 @@ class DynamicEntityReferenceBaseFieldTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->entity = $entity;
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $entity->getEntityTypeId(), '%id' => NULL]));
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $entity->getEntityTypeId()]));
 
     // @todo Implement a test case for invalid bundle references after
     // https://drupal.org/node/2064191 is fixed
diff --git a/tests/src/Kernel/DynamicEntityReferenceFieldTest.php b/tests/src/Kernel/DynamicEntityReferenceFieldTest.php
index 1d48e1e..88d7d11 100644
--- a/tests/src/Kernel/DynamicEntityReferenceFieldTest.php
+++ b/tests/src/Kernel/DynamicEntityReferenceFieldTest.php
@@ -4,6 +4,7 @@ namespace Drupal\Tests\dynamic_entity_reference\Kernel;
 
 use Drupal\config\Tests\SchemaCheckTestTrait;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\entity_test\Entity\EntityTestBundle;
 use Drupal\entity_test\Entity\EntityTestStringId;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
@@ -29,7 +30,7 @@ class DynamicEntityReferenceFieldTest extends EntityKernelTestBase {
    *
    * @var string
    */
-  protected $referencedEntityType = 'entity_test_rev';
+  protected $referencedEntityType = 'entity_test_with_bundle';
 
   /**
    * The bundle used in this test.
@@ -58,7 +59,7 @@ class DynamicEntityReferenceFieldTest extends EntityKernelTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->installEntitySchema('entity_test_rev');
+    $this->installEntitySchema('entity_test_with_bundle');
 
     // Create a field.
     FieldStorageConfig::create([
@@ -79,7 +80,14 @@ class DynamicEntityReferenceFieldTest extends EntityKernelTestBase {
       'entity_type' => $this->entityType,
       'bundle' => $this->bundle,
       'label' => 'Field test',
-      'settings' => [],
+      'settings' => [
+        $this->referencedEntityType => [
+          'handler' => 'default:' . $this->referencedEntityType,
+          'handler_settings' => [
+            'target_bundles' => NULL,
+          ],
+        ],
+      ],
     ])->save();
 
   }
@@ -128,7 +136,7 @@ class DynamicEntityReferenceFieldTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->target_id = $referenced_entity->id();
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $this->entityType, '%id' => $referenced_entity->id()]));
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $this->entityType]));
 
     // Test an invalid entity.
     $entity = $entity_type_manager
@@ -137,10 +145,60 @@ class DynamicEntityReferenceFieldTest extends EntityKernelTestBase {
     $entity->{$this->fieldName}->entity = $entity;
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
-    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', ['%type' => $entity->getEntityTypeId(), '%id' => NULL]));
+    $this->assertEquals($violations[0]->getMessage(), t('The referenced entity type (%type) is not allowed for this field.', ['%type' => $entity->getEntityTypeId()]));
+
+    // Test bundle validation with empty array. Empty array means no bundle is
+    // allowed.
+    $field_config = $this->container->get('entity_type.manager')
+      ->getStorage('field_config')
+      ->load($this->entityType . '.' . $this->bundle . '.' . $this->fieldName);
+    // Empty array means no target bundles are allowed.
+    $settings = [
+      'handler' => 'default:' . $this->referencedEntityType,
+      'handler_settings' => [
+        'target_bundles' => [],
+      ],
+    ];
+    $field_config->setSetting('entity_test_with_bundle', $settings);
+    $field_config->save();
+
+    $entity = $entity_type_manager
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $referenced_entity->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $referenced_entity->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
+    $this->assertEquals($violations[0]->getMessage(), t('No bundle is allowed for (%type)', ['%type' => $this->referencedEntityType]));
 
-    // @todo Implement a test case for invalid bundle references after
-    // https://drupal.org/node/2064191 is fixed
+    // Test with wrong bundle.
+    $bundle = EntityTestBundle::create([
+      'id' => 'newbundle',
+      'label' => 'New Bundle',
+      'revision' => FALSE,
+    ]);
+    $bundle->save();
+
+    $field_config = $this->container->get('entity_type.manager')
+      ->getStorage('field_config')
+      ->load($this->entityType . '.' . $this->bundle . '.' . $this->fieldName);
+    $settings = [
+      'handler' => 'default:' . $this->referencedEntityType,
+      'handler_settings' => [
+        'target_bundles' => ['newbundle'],
+      ],
+    ];
+    $field_config->setSetting('entity_test_with_bundle', $settings);
+    $field_config->save();
+
+    $entity = $entity_type_manager
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $referenced_entity->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $referenced_entity->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEquals($violations->count(), 1, 'Validation throws a violation.');
+    $this->assertEquals($violations[0]->getMessage(), t('Referenced entity %label does not belong to one of the supported bundles (%bundles).', ['%label' => $referenced_entity->label(), '%bundles' => 'newbundle']));
   }
 
   /**
diff --git a/tests/src/Kernel/DynamicEntityReferenceItemTest.php b/tests/src/Kernel/DynamicEntityReferenceItemTest.php
index 7b58975..f7fa496 100644
--- a/tests/src/Kernel/DynamicEntityReferenceItemTest.php
+++ b/tests/src/Kernel/DynamicEntityReferenceItemTest.php
@@ -91,7 +91,14 @@ class DynamicEntityReferenceItemTest extends FieldKernelTestBase {
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
       'label' => 'Foo Bar',
-      'settings' => [],
+      'settings' => [
+        'taxonomy_term' => [
+          'handler' => 'default:taxonomy_term',
+          'handler_settings' => [
+            'target_bundles' => NULL,
+          ],
+        ],
+      ],
     ])->save();
   }
 
@@ -211,6 +218,13 @@ class DynamicEntityReferenceItemTest extends FieldKernelTestBase {
 
     // Test the generateSampleValue() method.
     $entity = EntityTest::create();
+    // Created a term because the generateSampleItems relies on having terms in
+    // vocabulary.
+    Term::create([
+      'name' => $this->randomMachineName(),
+      'vid' => $this->term->bundle(),
+      'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
+    ])->save();
     $entity->field_der->generateSampleItems();
     $entity->field_der->generateSampleItems();
     $this->entityValidateAndSave($entity);
@@ -368,7 +382,7 @@ class DynamicEntityReferenceItemTest extends FieldKernelTestBase {
     $errors = $entity->validate();
     $this->assertCount(1, $errors);
     $this->assertEquals($errors[0]->getMessage(), (string) new FormattableMarkup('%property should not be null.', ['%property' => 'target_id']));
-    $this->assertEquals($errors[0]->getPropertyPath(), 'field_der.0');
+    $this->assertEquals($errors[0]->getPropertyPath(), 'field_der.0.target_id');
     // This should rectify the issue, favoring the entity over the target_id.
     $entity->save();
     $errors = $entity->validate();
