diff --git a/src/DynamicEntityReferenceFieldItemList.php b/src/DynamicEntityReferenceFieldItemList.php
index 5f6ae5f..af595ee 100644
--- a/src/DynamicEntityReferenceFieldItemList.php
+++ b/src/DynamicEntityReferenceFieldItemList.php
@@ -80,20 +80,16 @@ class DynamicEntityReferenceFieldItemList extends EntityReferenceFieldItemList {
       $entity_uuids = array();
       foreach ($all_uuids as $target_type => $uuids) {
         if ($uuids) {
-          $entity_ids = \Drupal::entityQuery($target_type)
-            ->condition('uuid', $uuids, 'IN')
-            ->execute();
           $entities = \Drupal::entityManager()
             ->getStorage($target_type)
-            ->loadMultiple($entity_ids);
+            ->loadByProperties(array('uuid' => $uuids));
           $entity_uuids[$target_type] = array();
           foreach ($entities as $id => $entity) {
             $entity_uuids[$target_type][$entity->uuid()] = $id;
           }
           foreach ($uuids as $delta => $uuid) {
-            if (isset($entity_uuids[$uuid])) {
+            if (isset($entity_uuids[$target_type]) && isset($entity_uuids[$target_type][$uuid])) {
               $default_value[$delta]['target_id'] = $entity_uuids[$target_type][$uuid];
-              $default_value[$delta]['target_type'] = $target_type;
               unset($default_value[$delta]['target_uuid']);
             }
             else {
diff --git a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
index 6593ed8..44e5a35 100644
--- a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
+++ b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
@@ -140,6 +140,11 @@ class DynamicEntityReferenceItem extends ConfigurableEntityReferenceItem {
 
   /**
    * {@inheritdoc}
+   *
+   * To select both target_type and target_id the option value is
+   * changed from target_id to target_type-target_id.
+   *
+   * @see \Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget\DynamicEntityReferenceOptionsTrait::massageFormValues()
    */
   public function getSettableOptions(AccountInterface $account = NULL) {
     $field_definition = $this->getFieldDefinition();
@@ -153,12 +158,14 @@ class DynamicEntityReferenceItem extends ConfigurableEntityReferenceItem {
       return array();
     }
     $return = array();
-    foreach ($options as $target_type) {
+    foreach ($options as $target_type => $referenceable_entities) {
       // Rebuild the array by changing the bundle key into the bundle label.
       $bundles = \Drupal::entityManager()->getBundleInfo($target_type);
-      foreach ($options[$target_type] as $bundle => $entity_ids) {
+      foreach ($referenceable_entities as $bundle => $entities) {
         $bundle_label = String::checkPlain($bundles[$bundle]['label']);
-        $return[$target_types[$target_type]][$bundle_label] = $entity_ids;
+        foreach ($entities as $id => $entity_label) {
+          $return[$bundle_label]["{$target_type}-{$id}"] = $entity_label;
+        }
       }
     }
 
@@ -321,6 +328,14 @@ class DynamicEntityReferenceItem extends ConfigurableEntityReferenceItem {
   /**
    * {@inheritdoc}
    */
+  public static function mainPropertyName() {
+    // We have two main properties i.e. target_type and target_id.
+    return NULL;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function setValue($values, $notify = TRUE) {
     if (empty($values['target_type']) && !empty($values['target_id'])) {
       throw new \InvalidArgumentException('No entity type was provided, value is not a valid entity.');
@@ -420,14 +435,13 @@ class DynamicEntityReferenceItem extends ConfigurableEntityReferenceItem {
     if (is_array($field_definition->default_value) && count($field_definition->default_value)) {
       $target_entity_types = static::getTargetTypes($field_definition->getFieldStorageDefinition()->getSettings());
       foreach ($target_entity_types as $target_entity_type) {
-        $key = $target_entity_type instanceof ConfigEntityType ? 'config' : 'content';
         foreach ($field_definition->default_value as $default_value) {
           if (is_array($default_value) && isset($default_value['target_uuid']) && isset($default_value['target_type'])) {
             $entity = \Drupal::entityManager()->loadEntityByUuid($default_value['target_type'], $default_value['target_uuid']);
             // If the entity does not exist do not create the dependency.
             // @see \Drupal\Core\Field\DynamicEntityReferenceFieldItemList::processDefaultValue()
             if ($entity) {
-              $dependencies[$key][] = $entity->getConfigDependencyName();
+              $dependencies[$entity->getConfigDependencyKey()][] = $entity->getConfigDependencyName();
             }
           }
         }
diff --git a/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsButtonsWidget.php b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsButtonsWidget.php
new file mode 100644
index 0000000..df511ce
--- /dev/null
+++ b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsButtonsWidget.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget\DynamicEntityReferenceOptionsButtonsWidget.
+ */
+
+namespace Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget;
+
+use Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsButtonsWidget;
+
+/**
+ * Plugin implementation of the 'options_buttons' widget.
+ *
+ * @FieldWidget(
+ *   id = "dynamic_entity_reference_options_buttons",
+ *   label = @Translation("Check boxes/radio buttons"),
+ *   field_types = {
+ *     "dynamic_entity_reference",
+ *   },
+ *   multiple_values = TRUE
+ * )
+ */
+class DynamicEntityReferenceOptionsButtonsWidget extends OptionsButtonsWidget {
+  use DynamicEntityReferenceOptionsTrait;
+
+}
diff --git a/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsSelectWidget.php b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsSelectWidget.php
new file mode 100644
index 0000000..a2aa4f3
--- /dev/null
+++ b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsSelectWidget.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget\DynamicEntityReferenceOptionsSelectWidget.
+ */
+
+namespace Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget;
+
+use Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsSelectWidget;
+
+/**
+ * Plugin implementation of the 'options_select' widget.
+ *
+ * @FieldWidget(
+ *   id = "dynamic_entity_reference_options_select",
+ *   label = @Translation("Select list"),
+ *   field_types = {
+ *     "dynamic_entity_reference",
+ *   },
+ *   multiple_values = TRUE
+ * )
+ */
+class DynamicEntityReferenceOptionsSelectWidget extends OptionsSelectWidget {
+
+  use DynamicEntityReferenceOptionsTrait;
+
+}
diff --git a/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsTrait.php b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsTrait.php
new file mode 100644
index 0000000..7c366f2
--- /dev/null
+++ b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceOptionsTrait.php
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget\DynamicEntityReferenceOptionsTrait.
+ */
+
+namespace Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget;
+
+
+use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\OptGroup;
+use Drupal\dynamic_entity_reference\Plugin\Field\FieldType\DynamicEntityReferenceItem;
+
+trait DynamicEntityReferenceOptionsTrait {
+
+  /**
+   * {@inheritdoc}
+   *
+   * This widget only support single target type dynamic entity reference
+   * fields. Select list Check boxes and radio buttons don't make sense for
+   * multiple target_types.
+   */
+  public static function isApplicable(FieldDefinitionInterface $field_definition) {
+    return count(DynamicEntityReferenceItem::getTargetTypes($field_definition->getSettings())) == 1;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getSelectedOptions(FieldItemListInterface $items, $delta = 0) {
+    // We need to check against a flat list of options.
+    $flat_options = OptGroup::flattenOptions($this->getOptions($items->getEntity()));
+
+    $selected_options = array();
+    foreach ($items as $item) {
+      $value = "{$item->target_type}-{$item->target_id}";
+      // Keep the value if it actually is in the list of options (needs to be
+      // checked against the flat list).
+      if (isset($flat_options[$value])) {
+        $selected_options[] = $value;
+      }
+    }
+
+    return $selected_options;
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * To save both target_type and target_id the option value is split into
+   * target_type and target_id.
+   *
+   * @see \Drupal\dynamic_entity_reference\Plugin\Field\FieldType\DynamicEntityReferenceItem::getSettableOptions()
+   */
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
+    foreach ($values as $index => $value) {
+      list($values[$index]['target_type'], $values[$index]['target_id']) = explode('-', $value['target_id']);
+    }
+    return $values;
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * @todo Remove this when https://www.drupal.org/node/2426781 is fixed.
+   */
+  protected function getOptions(FieldableEntityInterface $entity) {
+    if (!isset($this->options)) {
+      // Limit the settable options for the current user account.
+      $options = $this->fieldDefinition
+        ->getFieldStorageDefinition()
+        ->getOptionsProvider($this->column, $entity)
+        ->getSettableOptions(\Drupal::currentUser());
+
+      // Add an empty option if the widget needs one.
+      if ($empty_option = $this->getEmptyOption()) {
+        switch ($this->getPluginId()) {
+          case 'options_buttons':
+            $label = t('N/A');
+            break;
+
+          case 'options_select':
+            $label = ($empty_option == static::OPTIONS_EMPTY_NONE ? t('- None -') : t('- Select a value -'));
+            break;
+
+          default:
+            $label = $this->getEmptyLabel();
+        }
+
+        $options = array('_none' => $label) + $options;
+      }
+
+      $module_handler = \Drupal::moduleHandler();
+      $context = array(
+        'fieldDefinition' => $this->fieldDefinition,
+        'entity' => $entity,
+      );
+      $module_handler->alter('options_list', $options, $context);
+
+      array_walk_recursive($options, array($this, 'sanitizeLabel'));
+
+      // Options might be nested ("optgroups"). If the widget does not support
+      // nested options, flatten the list.
+      if (!$this->supportsGroups()) {
+        $options = OptGroup::flattenOptions($options);
+      }
+
+      $this->options = $options;
+    }
+    return $this->options;
+  }
+
+  /**
+   * Returns the empty option label .
+   *
+   * @return string|null
+   *   Either string, or NULL.
+   */
+  protected function getEmptyLabel()  {
+    $plugin_id = $this->getPluginId();
+    if (strpos($plugin_id, 'buttons') !== FALSE) {
+      $label = t('N/A');
+    }
+    else {
+      $label = ($this->getEmptyOption() == static::OPTIONS_EMPTY_NONE ? t('- None -') : t('- Select a value -'));
+    }
+    return $label;
+  }
+}
diff --git a/src/Tests/DynamicEntityReferenceFieldDefaultValueTest.php b/src/Tests/DynamicEntityReferenceFieldDefaultValueTest.php
new file mode 100644
index 0000000..47420cb
--- /dev/null
+++ b/src/Tests/DynamicEntityReferenceFieldDefaultValueTest.php
@@ -0,0 +1,137 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\dynamic_entity_reference\Tests\DynamicEntityReferenceFieldDefaultValueTest.
+ */
+
+namespace Drupal\dynamic_entity_reference\Tests;
+
+use Drupal\Component\Utility\Unicode;
+use Drupal\config\Tests\SchemaCheckTestTrait;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\simpletest\WebTestBase;
+use Symfony\Component\CssSelector\CssSelector;
+
+/**
+ * Tests dynamic entity reference field default values storage in CMI.
+ *
+ * @group dynamic_entity_reference
+ */
+class DynamicEntityReferenceFieldDefaultValueTest extends WebTestBase {
+  use SchemaCheckTestTrait;
+
+  /**
+   * A user with permission to administer content types, node fields, etc.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $adminUser;
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = array(
+    'dynamic_entity_reference',
+    'field_ui',
+    'node',
+  );
+
+  /**
+   * Permissions to grant admin user.
+   *
+   * @var array
+   */
+  protected $permissions = array(
+    'access content',
+    'administer content types',
+    'administer node fields',
+    'administer node form display',
+    'bypass node access',
+  );
+
+  protected function setUp() {
+    parent::setUp();
+
+    // Create default content type.
+    $this->drupalCreateContentType(array('type' => 'reference_content'));
+    $this->drupalCreateContentType(array('type' => 'referenced_content'));
+
+    // Create admin user.
+    $this->adminUser = $this->drupalCreateUser($this->permissions);
+    $this->drupalLogin($this->adminUser);
+  }
+
+  /**
+   * Tests that default values are correctly translated to UUIDs in config.
+   */
+  function testEntityReferenceDefaultValue() {
+    // Create a node to be referenced.
+    $referenced_node = $this->drupalCreateNode(array('type' => 'referenced_content'));
+
+    $field_name = Unicode::strtolower($this->randomMachineName());
+    $field_storage = FieldStorageConfig::create(array(
+      'field_name' => $field_name,
+      'entity_type' => 'node',
+      'type' => 'dynamic_entity_reference',
+      'settings' => array(
+        'exclude_entity_types' => FALSE,
+        'entity_type_ids' => array(
+          'node' => 'node',
+        ),
+      ),
+    ));
+    $field_storage->save();
+    FieldConfig::create(array(
+      'field_storage' => $field_storage,
+      'bundle' => 'reference_content',
+      'settings' => array(
+        'node' => array(
+          'handler' => 'default',
+          'handler_settings' => array(
+            'target_bundles' => array('referenced_content'),
+            'sort' => array('field' => '_none'),
+          ),
+        ),
+      ),
+    ))->save();
+
+    // Set created node as default_value.
+    $field_edit = array(
+      'default_value_input[' . $field_name . '][0][target_type]' => $referenced_node->getEntityTypeId(),
+      'default_value_input[' . $field_name . '][0][target_id]' => $referenced_node->getTitle() . ' (' .$referenced_node->id() . ')',
+    );
+    $this->drupalPostForm('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $field_name, $field_edit, t('Save settings'));
+
+    // Check that default value is selected in default value form.
+    $this->drupalGet('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $field_name);
+    $this->assertFieldByXPath(CssSelector::toXPath('select[name="default_value_input[' . $field_name . '][0][target_type]"] > option[value='. $referenced_node->getEntityTypeId() .']'), 'Content', 'The default target type value is selected in instance settings page');
+    $this->assertRaw('name="default_value_input[' . $field_name . '][0][target_id]" value="' . $referenced_node->getTitle() .' (' . $referenced_node->id() . ')', 'The default value is selected in instance settings page');
+
+    // Check if the ID has been converted to UUID in config entity.
+    $config_entity = $this->config('field.field.node.reference_content.' . $field_name)->get();
+    $this->assertTrue(isset($config_entity['default_value'][0]['target_uuid']), 'Default value contains target_uuid property');
+    $this->assertEqual($config_entity['default_value'][0]['target_uuid'], $referenced_node->uuid(), 'Content uuid and config entity uuid are the same');
+    // Ensure the configuration has the expected dependency on the entity that
+    // is being used a default value.
+    $this->assertEqual(array($referenced_node->getConfigDependencyName()), $config_entity['dependencies']['content']);
+
+    // Clear field definitions cache in order to avoid stale cache values.
+    \Drupal::entityManager()->clearCachedFieldDefinitions();
+
+    // Create a new node to check that UUID has been converted to numeric ID.
+    $new_node = entity_create('node', array('type' => 'reference_content'));
+    $this->assertEqual($new_node->get($field_name)->offsetGet(0)->target_type, $referenced_node->getEntityTypeId());
+    $this->assertEqual($new_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id());
+
+    // Ensure that the entity reference config schemas are correct.
+    $field_config = $this->config('field.field.node.reference_content.' . $field_name);
+    $this->assertConfigSchema(\Drupal::service('config.typed'), $field_config->getName(), $field_config->get());
+    $field_storage_config = $this->config('field.storage.node.' . $field_name);
+    $this->assertConfigSchema(\Drupal::service('config.typed'), $field_storage_config->getName(), $field_storage_config->get());
+  }
+
+}
diff --git a/src/Tests/DynamicEntityReferenceWidgetTest.php b/src/Tests/DynamicEntityReferenceWidgetTest.php
new file mode 100644
index 0000000..f19c342
--- /dev/null
+++ b/src/Tests/DynamicEntityReferenceWidgetTest.php
@@ -0,0 +1,179 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\dynamic_entity_reference\Tests\DynamicEntityReferenceWidgetTest.
+ */
+
+namespace Drupal\dynamic_entity_reference\Tests;
+
+use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Url;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests dynamic entity reference field widgets.
+ *
+ * @group dynamic_entity_reference
+ */
+class DynamicEntityReferenceWidgetTest extends WebTestBase {
+
+  /**
+   * A user with permission to administer content types, node fields, etc.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $adminUser;
+
+  /**
+   * The field name
+   *
+   * @var string
+   */
+  protected $fieldName;
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = array(
+    'dynamic_entity_reference',
+    'field_ui',
+    'node',
+  );
+
+  /**
+   * Permissions to grant admin user.
+   *
+   * @var array
+   */
+  protected $permissions = array(
+    'access content',
+    'administer content types',
+    'administer node fields',
+    'administer node form display',
+    'bypass node access',
+  );
+
+  protected function setUp() {
+    parent::setUp();
+
+    // Create default content type.
+    $this->drupalCreateContentType(array('type' => 'reference_content'));
+    $this->drupalCreateContentType(array('type' => 'referenced_content'));
+
+    // Create admin user.
+    $this->adminUser = $this->drupalCreateUser($this->permissions);
+
+    $field_name = Unicode::strtolower($this->randomMachineName());
+    $field_storage = FieldStorageConfig::create(array(
+      'field_name' => $field_name,
+      'entity_type' => 'node',
+      'type' => 'dynamic_entity_reference',
+      'settings' => array(
+        'exclude_entity_types' => FALSE,
+        'entity_type_ids' => array(
+          'node' => 'node',
+        ),
+      ),
+    ));
+    $field_storage->save();
+    FieldConfig::create(array(
+      'field_storage' => $field_storage,
+      'bundle' => 'reference_content',
+      'settings' => array(
+        'node' => array(
+          'handler' => 'default',
+          'handler_settings' => array(
+            'target_bundles' => array('referenced_content'),
+            'sort' => array('field' => '_none'),
+          ),
+        ),
+      ),
+    ))->save();
+    $this->fieldName = $field_name;
+  }
+
+  /**
+   * Tests default autocomplete widget.
+   */
+  function testEntityReferenceDefaultWidget() {
+    $field_name = $this->fieldName;
+    entity_get_form_display('node', 'reference_content', 'default')
+      ->setComponent($field_name, array(
+        'type' => 'dynamic_entity_reference_default',
+      ))
+      ->save();
+    $this->drupalLogin($this->adminUser);
+    // Create a node to be referenced.
+    $referenced_node = $this->drupalCreateNode(array('type' => 'referenced_content'));
+    $title = $this->randomMachineName();
+    $edit = array(
+      'title[0][value]' => $title,
+      $field_name . '[0][target_type]' => $referenced_node->getEntityTypeId(),
+      $field_name . '[0][target_id]' => $referenced_node->getTitle() . ' (' .$referenced_node->id() . ')',
+    );
+    $this->drupalPostForm(Url::fromRoute('node.add', array('node_type' => 'reference_content')), $edit, t('Save'));
+    $this->assertRaw(t('@type %title has been created.', array('@type' => 'reference_content', '%title' => $title)));
+    $nodes = \Drupal::entityManager()->getStorage('node')->loadByProperties(array('title' => $title));
+    $reference_node = reset($nodes);
+    $this->assertEqual($reference_node->get($field_name)->offsetGet(0)->target_type, $referenced_node->getEntityTypeId());
+    $this->assertEqual($reference_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id());
+  }
+
+  /**
+   * Tests option button widget.
+   */
+  function testEntityReferenceOptionsButtonsWidget() {
+    $field_name = $this->fieldName;
+    entity_get_form_display('node', 'reference_content', 'default')
+      ->setComponent($field_name, array(
+        'type' => 'dynamic_entity_reference_options_buttons',
+      ))
+      ->save();
+    $this->drupalLogin($this->adminUser);
+    // Create a node to be referenced.
+    $referenced_node = $this->drupalCreateNode(array('type' => 'referenced_content'));
+    $title = $this->randomMachineName();
+    $edit = array(
+      'title[0][value]' => $title,
+      $field_name => $referenced_node->getEntityTypeId() . '-' .$referenced_node->id(),
+    );
+    $this->drupalPostForm(Url::fromRoute('node.add', array('node_type' => 'reference_content')), $edit, t('Save'));
+    $this->assertRaw(t('@type %title has been created.', array('@type' => 'reference_content', '%title' => $title)));
+    $nodes = \Drupal::entityManager()->getStorage('node')->loadByProperties(array('title' => $title));
+    $reference_node = reset($nodes);
+    $this->assertEqual($reference_node->get($field_name)->offsetGet(0)->target_type, $referenced_node->getEntityTypeId());
+    $this->assertEqual($reference_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id());
+  }
+
+  /**
+   * Tests option select widget.
+   */
+  function testEntityReferenceOptionsSelectWidget() {
+    $field_name = $this->fieldName;
+    entity_get_form_display('node', 'reference_content', 'default')
+      ->setComponent($field_name, array(
+        'type' => 'dynamic_entity_reference_options_select',
+      ))
+      ->save();
+    $this->drupalLogin($this->adminUser);
+    // Create a node to be referenced.
+    $referenced_node = $this->drupalCreateNode(array('type' => 'referenced_content'));
+    $title = $this->randomMachineName();
+    $edit = array(
+      'title[0][value]' => $title,
+      $field_name => $referenced_node->getEntityTypeId() . '-' .$referenced_node->id(),
+    );
+    $this->drupalPostForm(Url::fromRoute('node.add', array('node_type' => 'reference_content')), $edit, t('Save'));
+    $this->assertRaw(t('@type %title has been created.', array('@type' => 'reference_content', '%title' => $title)));
+    $nodes = \Drupal::entityManager()->getStorage('node')->loadByProperties(array('title' => $title));
+    $reference_node = reset($nodes);
+    $this->assertEqual($reference_node->get($field_name)->offsetGet(0)->target_type, $referenced_node->getEntityTypeId());
+    $this->assertEqual($reference_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id());
+  }
+
+}
